sbi icon indicating copy to clipboard operation
sbi copied to clipboard

Add interface to PyMC MCMC samplers

Open janfb opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe.

For MCMC sampling we provide our own slice_np_vectorized MCMC samplers, and an interface to Pyro HMC and NUTS samplers. The interface to Pyro is enabled by specifying a potential_fn, i.e., a Callable that returns the potential energy given a set of parameters. We defined a wrapper for that here.

Describe the solution you'd like

I would be great to do something analog to enable access to PyMC MCMC samplers. I am not sure how the potential_fn can be used in this context. It seems PyMC handles things differently. The approach for this feature request would be:

  • find out how PyMC MCMC can be accessed: https://www.pymc.io/projects/docs/en/stable/_modules/pymc/sampling/mcmc.html
  • implement a wrapper from sbi potential functions to PyMC MCMC samplers
  • add new sampler options to MCMCPosterior, e.g., hmc_pymc, nuts_pymc etc.

Related to #908

janfb avatar Mar 12 '24 16:03 janfb