You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docstring of log_logistic references scipy's expit and explains that the log case isn't here for efficiency but for stability... Any reason to doubt that?
The docstring of log_logistic references scipy's expit and explains that the log case isn't here for efficiency but for stability... Any reason to doubt that?
I don't think scipy's implementation is not stable. If so, maybe we should open an issue in scipy.
And I found the following comments: #2882 (comment) #2882 (comment)
It's not about the stability of expit, it's about the stability of log(expit). Basically here we avoid computing exp for big values, which might make sense. Also we avoid calling exp twice (as would be needed in expit).
As noted above scipy's expit is only supported in new versions of scipy so we would have to write our own anyway (that's what I'm doing in #12807 ).
If we want our implementation to be faster, we can start by cdefing the loop variables i and j, and inlining the inner function.
Activity
jnothman commentedon Mar 25, 2019
The docstring of log_logistic references scipy's expit and explains that the log case isn't here for efficiency but for stability... Any reason to doubt that?
qinhanmin2014 commentedon Mar 25, 2019
I don't think scipy's implementation is not stable. If so, maybe we should open an issue in scipy.
And I found the following comments:
#2882 (comment)
#2882 (comment)
jnothman commentedon Mar 25, 2019
NicolasHug commentedon Mar 25, 2019
It's not about the stability of
expit, it's about the stability oflog(expit). Basically here we avoid computing exp for big values, which might make sense. Also we avoid callingexptwice (as would be needed in expit).As noted above scipy's
expitis only supported in new versions of scipy so we would have to write our own anyway (that's what I'm doing in #12807 ).If we want our implementation to be faster, we can start by
cdefing the loop variablesiandj, and inlining the inner function.qinhanmin2014 commentedon Mar 25, 2019
@NicolasHug
I can't understand what's the stability of
log(expit)(will be grateful to see an example comparing our implementation and scipy)scipy also do these things?
qinhanmin2014 commentedon Mar 25, 2019
Ahh, I suddenly realized that I made some foolish mistakes. @NicolasHug you're right. Apologies for the noise.