-
Notifications
You must be signed in to change notification settings - Fork 160
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
Tutorial on particle filters should emphasize that model that calls Unfold
needs to be static
#449
Comments
Why is this necessary, actually? |
In the current implementation, if the I think there are slight changes we could make to the current implementation of Unfold so that |
Ok, so at least it's a performance concern rather than a correctness concern. |
I actually can't reproduce this in a standalone example...? @gen (static) function kernel(i::Int, zₜ, σ)
zₜ₊₁ ~ normal(zₜ, σ)
return zₜ₊₁
end
@gen (static) function static_unfold(z₀, n::Int)
σ ~ exponential(0.1)
return @trace(Unfold(kernel)(n, z₀, σ), :unfold)
end
@gen function dynamic_unfold(z₀, n::Int)
σ ~ exponential(0.1)
return @trace(Unfold(kernel)(n, z₀, σ), :unfold)
end
@benchmark simulate(static_unfold, (0.0,1000))
@benchmark simulate(dynamic_unfold, (0.0,1000))
Does it depend on the type of arguments? |
|
After going through the tutorial on particle filters, @kach ran into issues trying to get incremental computation working, and it turned out this was because of not annotating the model that calls the
Unfold
combinator with static. Ideally, this would be emphasized in the tutorial (and the docs) so that others don't run into the same issue!The text was updated successfully, but these errors were encountered: