Would super appreciate help on this. I need to raise numbers to huge power (50+) & Python understandably overflows. Documentation is bad.
https://twitter.com/o_guest/status/839918241363410945 …
-
-
Replying to @o_guest
work with logs, And use numpy.logaddexp if you need to add. Or is that too obvious ?
2 replies 0 retweets 2 likes -
Replying to @alexandersclark
no it's not... Tell me more or link me? I'm currently running it just by casting to bigfloat where it was overflowing.
1 reply 0 retweets 0 likes -
Replying to @o_guest @alexandersclark
it looked like it was working so fingers crossed as I have left it running.
1 reply 0 retweets 0 likes -
Replying to @o_guest
take the logarithms of everything: google the log sum exp trick
1 reply 0 retweets 1 like -
Replying to @alexandersclark
Ahhhhhhh I see. Right I've left it running with big float, but will try what you said if it doesn't work. Or do you suspect
1 reply 0 retweets 0 likes -
-
Replying to @o_guest
depends on what you are doing .. are they probabilities ? There are other tricks to avoid underflow. Log is easy but inefficient
1 reply 0 retweets 0 likes -
Replying to @alexandersclark
it needs to be incredibly efficient as big data. It's actually a Luce choice weight.
1 reply 0 retweets 0 likes -
Replying to @o_guest
if you are mostly multiplying them - or raising to powers - then logs are worth it.
1 reply 0 retweets 1 like
yeah multiplying and raising
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
