-
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
Fix HMC in Gibbs issue with dynamic models #1217
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1217 +/- ##
==========================================
+ Coverage 65.59% 65.91% +0.31%
==========================================
Files 25 25
Lines 1279 1282 +3
==========================================
+ Hits 839 845 +6
+ Misses 440 437 -3
Continue to review full report at Codecov.
|
Cool, thanks! |
∂logπ∂θ = gen_∂logπ∂θ(spl.state.vi, spl, model) | ||
logπ = gen_logπ(spl.state.vi, spl, model) | ||
spl.state.h = AHMC.Hamiltonian(metric, logπ, ∂logπ∂θ) | ||
resize!(spl.state.z.θ, length(θ_old)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is worth noting that the vanilla HMC with identity mass matrix and pre-specified leapfrog step-size might be the only sensible HMC sampler for dynamic models for now, since the adaption schedules for step-size and mass matrix are not guaranteed to work well when the static dimensionality condition no longer holds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trappmartin Maybe add a warning for this in the Infinite Mixture Model example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I'll open a PR for this.
* fix TuringLang#1095 * add test * fix bug * test PG and MH * fix tests * avoid duplicate line
This PR fixes #1095 by making sure the position in the HMC PhasePoint is of the right length and value.
CC: @xukai92 @trappmartin