Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with logsumexp with ForwardDiff (and -Inf values) #59

Closed
theogf opened this issue Nov 21, 2022 · 1 comment · Fixed by #60
Closed

Issue with logsumexp with ForwardDiff (and -Inf values) #59

theogf opened this issue Nov 21, 2022 · 1 comment · Fixed by #60

Comments

@theogf
Copy link

theogf commented Nov 21, 2022

Here is a MWE:

julia> using ForwardDiff, LogExpFunctions

julia> x = log.([0.0; rand(10)]);

julia> ForwardDiff.gradient(logsumexp, x)
11-element Vector{Float64}:
 NaN
 NaN
 NaN
 NaN
 NaN
 NaN
 NaN
 NaN
 NaN
 NaN
 NaN
@devmotion
Copy link
Member

It works fine with ForwardDiff 0.10.32:

julia> using ForwardDiff, LogExpFunctions

julia> x = log.([0.0; rand(10)]);

julia> ForwardDiff.gradient(logsumexp, x)
11-element Vector{Float64}:
 0.0
 0.1378738196703953
 0.12866297288002634
 0.1500857601549507
 0.11279311035352795
 0.06729907609156742
 0.1124401188225104
 0.002025935493071411
 0.15585691506594368
 0.09113390666845002
 0.04182838479955667

So it seems this might another example that was broken by JuliaDiff/ForwardDiff.jl#481. This PR has created far too many downstream issues by now and should not have been included in a non-breaking release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants