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

StackOverflowError when sampling from mixture model #249

Open
BenjaminJCox opened this issue Jul 6, 2023 · 0 comments
Open

StackOverflowError when sampling from mixture model #249

BenjaminJCox opened this issue Jul 6, 2023 · 0 comments

Comments

@BenjaminJCox
Copy link

MWE:

using Distributions
using DistributionsAD
using Random

test_mm = MixtureModel([TuringDenseMvNormal(randn(10), collect(I(10))) for comp in 1:10])
rand(test_mm)

This type of code comes up as I construct a mixture distribution inside of the function I take the gradient of, so the construction of the mixture must explicitly be these distributions (otherwise one gets covert errors).

I have no idea why this behaviour happens, but it occurs even when only 1 component is in the mixture.
For now I can get around it by sampling the vector of distributions then sampling the result, but this is not ideal.

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

1 participant