-
Notifications
You must be signed in to change notification settings - Fork 246
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
Allow guides with re-initializable parameters #655
Allow guides with re-initializable parameters #655
Conversation
459a430
to
563dd7b
Compare
Useful for Stein
563dd7b
to
022ca6e
Compare
Thanks for splitting out your PR, @ahmadsalim! IIUC you want two things:
I think we can start with a FYI, we just recently move autoguide to the main How about the following proposals:
|
Thanks for taking a look! I do not need MCMC for param statements. I would still like them to be categorized as parameters, so that Stein knows that these are the particles to optimize. This is since Stein treats specified parameters as particles, kind of like a generalization of SVI but where we infer multiple values for each parameter using Stein instead of a single one (based on Stein mixture models paper). |
I do not have anything against moving things to Could you kindly explain how |
I think it will just be a port of http://docs.pyro.ai/en/stable/poutine.html#pyro.poutine.handlers.lift Do you use those initialization steps in inference? If not, then you can lift to get initial params, then doing inference with your original model as usual. |
Oh, that would be great to have! Then I can drop my other changes to the initialization functions 😄 |
Sorry for the delay! I'll port |
Awesome, thanks a lot! I was actually not sure what the conclusion was and started looking into implementing it myself 😄 . But I appreciate you looking into it! |
Haha, me too. I thought that you were waiting for it so I just went ahead and implemented. :D |
Wow, this is embarrassing. I missed that the I will figure out how to re-open the PRs as originally planned, but will close this one. |
@fehiepsi Thanks a lot for |
Sure, please let us know if you need any features else. I hope that NumPyro design should not block much of your work, so hopefully, you only need to play with the algorithm. :) |
Cool! Thanks a lot :) |
The first split of #649 .
It introduces re-initializable guides, which can re-initialize their parameters.
This is useful for Stein inference since the parameters are treated as particles, and we want the particles to be initialized independently instead of all clumped together which would hurt inference.
An alternative would be to have similar strategies which can be called explicitly with a shape and can be used directly in
numpyro.param
. I do not know which you prefer, so I tried to reuse the existing interface 😄