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

HMC for models with dynamic dimentionality #498

Closed
yebai opened this issue Sep 5, 2018 · 4 comments
Closed

HMC for models with dynamic dimentionality #498

yebai opened this issue Sep 5, 2018 · 4 comments

Comments

@yebai
Copy link
Member

yebai commented Sep 5, 2018

Excerpt from #495

Later, we made a design decision that during an HMC step, the dimensionality of parameters assigned to HMC shouldn't change. However, the dimensionality of parameters assigned to HMC can still change for different HMC steps. For example, if a new parameter is created during an HMC iteration and is assigned to HMC, then before the current HMC iteration finishes, the newly created parameter is not updated. Therefore, the newly created parameter value will stay the same as its initialization (e.g. a draw from its prior). This design simplifies the HMC implementation and makes the code you are referring to obsolete.

@xukai92 could you take a look at HMC and see whether the design above is correctly implemented?

@xukai92
Copy link
Member

xukai92 commented Sep 6, 2018

I think the current code doesn't do what you described. This is because during one refactoring, we decide to assume the model is static during the whole HMC and, and we removed the code to check whether a VarName is in VarInfo; if not, sample one in assume (https://github.com/TuringLang/Turing.jl/blob/master/src/samplers/hmc.jl#L178-L188), but always fetch one from VarInfo.

I could create a PR to pull that functionality back. Do you have a concrete model I could test on?

@mohamed82008
Copy link
Member

Could be relevant: https://github.com/tpapp/DynamicHMC.jl

@yebai yebai changed the title Dynamic HMC HMC for models with dynamic dimentionality Sep 6, 2018
@xukai92 xukai92 mentioned this issue Sep 13, 2018
8 tasks
@xukai92
Copy link
Member

xukai92 commented Dec 5, 2018

When a parameter is used for some iterations, then omitted for a few iterations, and used again: do I resample it from prior, or I use the previously-stored value? Also is there any literature about HMC with dynamic dimension?

@xukai92
Copy link
Member

xukai92 commented Jun 28, 2023

I believe the proper way to do this is via reversible-jump MCMC. Gen.jl can probably do that now.

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

No branches or pull requests

3 participants