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
function logsumexp_stream(X)
alpha = -Inf
r = 0.0
for x = X
if x <= alpha
r += exp(x - alpha)
else
r *= exp(alpha - x)
r += 1.0
alpha = x
end
end
log(r) + alpha
end
It has the advantage that a single pass over the data is required.
Consider adding a version of
logsumexp
for streaming data. I found this here:http://www.nowozin.net/sebastian/blog/streaming-log-sum-exp-computation.html
which includes the following Julia code:
It has the advantage that a single pass over the data is required.
Pinging @tpapp in case this should go into https://github.com/tpapp/LogExpFunctions.jl.
I can make a PR myself if people agree into adding this.
The text was updated successfully, but these errors were encountered: