-
Notifications
You must be signed in to change notification settings - Fork 150
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 MCMC transforms for MultipleIndependentConstraints prior #619
Conversation
bf17d79
to
36f60e0
Compare
36f60e0
to
041fb47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great, thanks!
let me know what you think of the tests, and feel free to adapt them.
@@ -9,7 +9,7 @@ | |||
from sbi.inference.posteriors.mcmc_posterior import MCMCPosterior | |||
import torch | |||
from pyknos.mdn.mdn import MultivariateGaussianMDN | |||
from scipy.stats import beta, multivariate_normal, uniform | |||
from scipy.stats import beta, multivariate_normal, uniform, lognorm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could move this test to transform_tests.py
, or copy it to keep both.
ef17a27
to
edf42ff
Compare
@@ -387,7 +387,7 @@ def check_prior_support(prior): | |||
""" | |||
|
|||
try: | |||
within_support(prior, prior.sample()) | |||
within_support(prior, prior.sample((1,))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a MultipleIndependent
distribution support.check(sample)
requires a batched sample
@@ -387,7 +387,7 @@ def check_prior_support(prior): | |||
""" | |||
|
|||
try: | |||
within_support(prior, prior.sample()) | |||
within_support(prior, prior.sample((1,))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
8fd59c5
to
cc8a956
Compare
cc8a956
to
dfb860d
Compare
This PR allows to infer the
transform
for priors that were provided asMultipleIndependentDistributions
.In addition, it allows inferring the transform for any bounded distribution (not just interval constraints)