Closed mbreyt closed 2 years ago
Hi there!
You probably just have to use a 1-dimensional MultivariateNormal
:
prior = torch.distributions.MultivariateNormal(0.5*torch.ones(1), 1*torch.eye(1))
Hope that helps! Michael
That was exactly the problem yes ! thank you very much !
Hello, I'm new to the field... I have a one dimensional model theta and x are 1D, and I'm trying to use SNLE with maf and mdn. What I'd like to do is to train the estimator on my data (theta was sampled from a uniform prior between 0 and 1) and then get a posterior with a more restrictive prior such as a narrow gaussian (of course centered within 0 and 1) to visualize the effect of the prior on my posterior estimate.
Please can someone tell me if I'm doing something wrong ?
Running on numpy: v1.21.6 Running on torch: v1.11.0 Running on sbi: v0.19.0
Here is my code:
When I use a uniform prior it works but not when I use a gaussian:
or
If I use sample_with='rejection' I get this error:
If I use sample_with='mcmc' I get this error: