sbi-dev / sbi

Simulation-based inference toolkit
https://sbi-dev.github.io/sbi/
Apache License 2.0
546 stars 133 forks source link

ignoring mcmc sampling #1144

Closed Ziaeemehr closed 2 months ago

Ziaeemehr commented 2 months ago

Suppose common steps in the sbi workflow

inference = SNPE(
                prior=prior, density_estimator=density_estimator, device=device)
inference = inference.append_simulations(theta, x)
estimator_ = inference.train()
posterior = inference.build_posterior(estimator_, sample_with="mcmc") # probably need to make a change here?
posterior.sample((num_samples,), x=xo)

This is needed specially when someone is putting the workflow in a loop and try on multiple dataset.

Cheers A

michaeldeistler commented 2 months ago

I don't understand the problem, why do you pass sample_with=mcmc if you do not want to sample with mcmc?