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
Handle dynamic support #241
Comments
Hmm..interesting. This will also be an issue with Pyro, and does seem serious because we will silently give wrong results. Maybe we should just have EDIT: This will cause issues with JIT. I think if we just throw an error in initialize_model for such cases, that will be a good start. |
Yup, this affects both autoguide and hmc inferences because both of them do inference in unconstrained space. As you said, this is indeed a serious problem. I think that we can resolve it by using non-centered reparametrization technique, that is to define each distribution as a transformed distribution with an affine transform. We do inference in the unconstrained domain of |
You mean the user has to use The alternative seems even trickier because that would involve finding the new transform for each single step of the integrator, and also storing the transform for each sample so that the unconstrained samples can later be transformed into constrained samples. |
I think we can just do it behind the scene. What I thought is to have log_density computed as follows
This way, we only need to revise Uniform/TruncatedCauchy/TruncatedNormal so that they are TransformedDistribution. Other transformed distributions or user-defined transformed distribution should work (
against the above proposal
Does this proposal sound reasonable to you? |
This seems very reasonable! I'm not quite sure why we need We can probably just test this out on a model that is user transformed to see that the logic in |
Also, this probably implies that we will need to do something like |
I think that this way is somehow redundant when we compute log_jacobian of
comparing to the above proposal
Basically, we don't care what dist's support is, we just care about
Yes, that is a disadvantage of the above proposal (but I guess it is cheap comparing to run an MCMC trajectory). |
Yup, I'll work on this next week but will definitely need your help on |
Thanks for explaining, this is pretty neat! 😄
I suppose this will only matter if we have
Please take your time. I'll work on the handlers part that you can build on top of. |
Just discover some edge case which we have not thought about it before. Consider the model
The support of
y
site does depend onx
soinitialize_model
will return different transforms for different initialrng
.The text was updated successfully, but these errors were encountered: