special function xlogy with 0log0=0
Jan. 14, 2011
7:31 p.m.
I'm trying to fix again a case with x*log(y) which was a converted log(0**0), where x and y should broadcast. Is it possible to get a special function for this. It shows up very often, and any cheap fix, e.g. term = x*np.log(y) term[(x==0)*(y==0)] = 0 raises a warning (which I now also see) x*log(y+1e-300) would be easier, but I don't know whether there are no cases where numerical precision deteriorates. In another version, Skipper clipped y What's the best way? Josef
5742
Age (days ago)
5742
Last active (days ago)
0 comments
1 participants
participants (1)
-
josef.pktd@gmail.com