sbi
sbi copied to clipboard
Refactor Pyro MCMC methods
Problem
The current setup for using Pyro MCMC methods is a bit of a mess:
- we have a pyro-specific MCMC class in
sbi/samples/mcmc/mcmc.py[1] - a pyro-specific implementation of a slice-sampler in
sbi/samples/mcmc/slice.py[2]
In mcmc_posterior we offer a MCMC sampling via pyro, e.g., pyro slice sampling via [2], and HMC and NUTS as implemented in pyro.
To me it seems we are never using the class defined [1] but instead use from pyro.infer.mcmc.api import MCMC to specify the MCMC kernel (slice, hmc, nuts).
Solution
Define a common interface for pyro MCMC methods in sbi. It should be possible use our own pyro slice sampler, or plug in pyro-based HMC or NUTS (or other pyro samplers). This could include:
- get rid of [1]
- rename
slice.pytoslice_pyro.pyand add more documentation - rename the keyword in
mcmc_posteriortoslice_pyroinstead of justslice.
Related / a subissue of #908