Skip to content
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

Refactor Pyro MCMC methods #986

Closed
janfb opened this issue Mar 12, 2024 · 1 comment
Closed

Refactor Pyro MCMC methods #986

janfb opened this issue Mar 12, 2024 · 1 comment
Labels
enhancement New feature or request hackathon

Comments

@janfb
Copy link
Contributor

janfb commented Mar 12, 2024

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.py to slice_pyro.py and add more documentation
  • rename the keyword in mcmc_posterior to slice_pyro instead of just slice.

Related / a subissue of #908

@janfb janfb added enhancement New feature or request hackathon labels Mar 12, 2024
@janfb janfb added this to the Hackathon 2024 milestone Mar 12, 2024
@janfb janfb changed the title Refactor pyro MCMC methods Refactor Pyro MCMC methods Mar 13, 2024
@gmoss13 gmoss13 assigned gmoss13 and unassigned gmoss13 Mar 19, 2024
@janfb
Copy link
Contributor Author

janfb commented Apr 9, 2024

solved via #1107

@janfb janfb closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hackathon
Projects
None yet
Development

No branches or pull requests

2 participants