-
Notifications
You must be signed in to change notification settings - Fork 160
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
logpdf_grad
errors for HomogeneousMixture
#445
Comments
Haven't looked in depth, but I suspect this is indeed due to an assumption somewhere that args to distributions will be flat, i.e. cannot be array-valued. The use of In general, the args to a distribution could be arrays of different shapes. I'm not aware of us having general machinery for flattening and unflattening arrays in the gradient operations (nor am I sure that flattening and unflattening is the right thing to do, necessarily). |
(Oops, misread a doc. Deleted comment.) |
@bzinberg Thanks for the quick reply! In the documentation for |
Hi @fzaiser! I think a lot of us were on winter break when you posted this and it fell through the cracks -- sorry about that! I think you're right that the (As an aside, HMC will struggle to explore multiple modes in this target — but I think that may be the point of the experiment :).) As Ben mentioned, there are parts of Gen (including the |
Hi @alex-lew, no problem and thanks for the fix! I hope to have some time to experiment with it soon. Indeed, I'm aware of HMC struggling with such a multi-modal distribution. :) I was just playing around with gradient-based inference methods when I hit the bug and HMC was the simplest way to reproduce it. |
The following example crashes:
It throws the following error:
I believe the reason is that in the line
Gen.jl/src/modeling_library/mixture.jl
Line 117 in fa759d3
length(dist.dims)
should be replaced byK
. This removes the exception, but I don't understand the code well enough to be sure that this is the correct fix or whether other parts of the code have to be fixed too.The text was updated successfully, but these errors were encountered: