-
Notifications
You must be signed in to change notification settings - Fork 220
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
Custom distributions required rand
to be implemented when "unnecessary"
#907
Comments
There is actually a way to set the initial parameterization in #793, but it's not really very robust: Turing.jl/src/inference/Inference.jl Line 179 in bf58264
I think @xukai92 and I talked briefly about making this a lot easier to use in a later PR. Currently you have to pass in a vector/iterable that's the same length as sample(m, HMC(1000, 0.1, 10), init_theta=[4.0, 2.0]) |
So in this PR we're no longer using the more robust
That works:) But yeah, I guess ideally we'd have a |
No, not quite -- it only does anything if you've provided a keyword argument. If you haven't then everything is initialized as before.
Yeah, I think that's probably the best way to go. |
Ah, sorry; misread
That looks really good 👍 You planning on including that in #793? |
Probably not. It's a little bloated as it is. Me or someone else will probably get to it in another PR. |
@torfjelde Is this issue still relevant? |
One might want to use
MH
,HMC
, etc. to sample from a distribution with unknown/intractable normalization factor rather than to sample from a posterior. In theory there's nothing prohibiting this kind of usage but it's currently not supported in Turing. Or, it is, but that requires theDistributions._rand!
(forMultivariateDistribution
) to be implemented either as the proposal or just to get the initial value. To me this seems quite hacky, at the very least non-intuitive.As of right now this is not possible for custom distributions due to most (if not all) sampler initialize the
VarInfo
using theSampleFromUniform
sampler. This means that callinit(dist)
, which defaults torand(dist)
if the distribution is not "transformable" (the case for all custom distributions).I believe this would be solved if we had a simple way of setting the initial value for the chain, so it's very related to #746 and possibly related to the new interface PR #793 (though I haven't gotten around to having a proper look at it, so not sure).
The text was updated successfully, but these errors were encountered: