-
Notifications
You must be signed in to change notification settings - Fork 219
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
Sampler initialization (init_params
)
#1563
Comments
I'm not even sure how to use @model function test(x)
a ~ Normal(1.0, 2.0)
println(a)
x ~ filldist(Normal(a, 0.1), length(x))
return a
end
sample(test([1.0, 2.0, 1.3]), NUTS(), 10; init_params = [3.1]) and it never goes through |
After some investigation it looks like this line: |
bors bot
pushed a commit
to TuringLang/DynamicPPL.jl
that referenced
this issue
Apr 18, 2021
…niform` (#232) This PR is a quick fix for TuringLang/Turing.jl#1563 and TuringLang/Turing.jl#1588. As explained in TuringLang/Turing.jl#1588 (comment), the problem is that currently `SampleFromUniform` always resamples variables in every run, and hence also initial parameters provided by users are resampled in https://github.com/TuringLang/DynamicPPL.jl/blob/9d4137eb33e83f34c484bf78f9a57f828b3c92a0/src/sampler.jl#L80. As mentioned in TuringLang/Turing.jl#1588 (comment), a better long term solution would be to fix this inconsistency and use dedicated evaluation and sampling contexts, as suggested in #80.
Likely fixed by TuringLang/DynamicPPL.jl#232 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
Could you add some documentation to sampler initialization (
init_params
)? Right now it's quite non-intuitive to use.I'm currently using the NUTS sampler for my model and unfortunately it tends to pick initial values of random variables that are far from the expected ones, and my model has numerical issues at such extreme values. Thus I'd like to start with some more likely initial values.
The text was updated successfully, but these errors were encountered: