-
Notifications
You must be signed in to change notification settings - Fork 218
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
Numerical errors on Turing v0.7.4 #1017
Comments
By the way, I discovered that the problem resolved when I downgrade to StatsFuns v0.8.0 and the errors start with v0.9.0. Its not clear to me what in that release is causing trouble with Turing. |
If you have a minimal working example, we can look further into it. |
Sorry about that. Thanks for looking into this more. Here is a much smaller example, indicating the problem is probably with logsumexp:
As before, the model works with StatsFuns v0.8.0. In addition, the model works when logsumexp is replaced with sum regardless of version. I suspect this is the culprit. |
@xukai92 any idea what could be happening here? |
The problem is that the new using ForwardDiff, StatsFuns
# New StatsFuns
julia> ForwardDiff.gradient(x -> StatsFuns.logsumexp(x), rand(4))
4-element Array{Float64,1}:
NaN
NaN
NaN
NaN
# Old StatsFuns
julia> ForwardDiff.gradient(x -> StatsFuns.logsumexp(x), rand(4))
4-element Array{Float64,1}:
0.1280594678275393
0.3043198459775647
0.30254704646302555
0.2650736397318705 |
The problem begins at the call to
|
Indeed, removing log from the initial value solves the problem (using v0.8.0):
|
I submitted a pull request with StatsFuns that fixes the error. Thanks for your help! |
Hi all-
After updating from Turing .7.3. to .7.4, I encountered tons of numerical errors (> 3000) for several of my models, causing a convergence failure. These models worked for previous versions of the Turing. I compared .7.3 and .7.4 using Julia 1.3.
Here is my setup for .7.3:
and for .7.4 :
Both versions use AdvancedHMC v0.2.14. So that does not appear to be the problem or at least the exclusive problem.
An example model can be found here and it can be ran with the file called Run baseline Fan model.jl
The text was updated successfully, but these errors were encountered: