Skip to content

[NeurIPS 2024] Sampling From Multiscale Densities With Delayed Rejection Generalized Hamiltonian Monte Carlo.

License

Notifications You must be signed in to change notification settings

gil2rok/drghmc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Delayed Rejection Generalized Hamiltonian Monte Carlo

Overview 🔭 | Quick Start 🚀 | Installation 🔧 | Experiments 🧑‍🔬 | Layout 📂 | Citation 📜 | Resources 📚

This repository contains code for experiments, manuscript, and poster of Sampling From Multiscale Densities with Delayed Rejection Generalized Hamiltonian Monte Carlo, submitted to NeurIPS 2024.

Consider checking out our:

  • Paper 📄. Endulge on ArXiv.
  • Poster 📊. Admire the bright orange theme.
  • Tweet 🐦. I crave your attention.

Overview 🔭

We propose the delayed rejection generalized Hamiltonian Monte Carlo (DR-G-HMC) algorithm to simultaneously solve two problems in Markov chain Monte Carlo sampling for Bayesian inference:

  • Multiscale densities: DR-G-HMC can sample from hierarchical models that exhibit varying curvature (ie multiscale) with dynamic step size selection, enabled by making multiple proposal attempts with decreasing step sizes in a single sampling iteration.
  • Inefficient G-HMC: DR-G-HMC replaces rejections with additional proposal attempts, thereby avoiding inefficient backtracking that plagues the generalized HMC (G-HMC) algorithm.

Extensive emperical experiments demonstrate that DR-G-HMC can indeed (1) sample from multiscale densities (unlike NUTS!) and (2) resolve the inefficiencies of G-HMC while (3) maintaining competitiveness with state of the art samplers on non-multiscale densities.

Quick Start 🚀

Tip

To use DR-G-HMC for your own hierarchical model with multiscale geometry, use the Bayes-Kit implementation.

Bayes-Kit is a readable, well documented repository for Bayesian inference algorithms in Python. Consider starring the repository ⭐ along with others Bayes-Kit !

Installation 🔧

To run experiments from the paper, run the following commands in your favorite virtual environment:

# clone project
git clone https://github.com/gil2rok/drghmc
cd drghmc

# install requirements
pip install -r requirements.txt

Experiments 🧑‍🔬

Reproduce experiements from the paper by running the following commands:

Layout 📂

drghmc/
├── configs/                # experiment configs
├── data/                   # store sampler draws
├── doc/                    # figures, paper manuscript, & poster
├── posteriors/             # Stan models with data & reference draws
├── scripts/                # scripts to run experiments
├── src/                    # sampler implementations

This repository also includes a README.md, requirements.txt, LICENSE, and .gitignore files. The data and posteriors directories also contain their own README.md files with more information.

Citation 📜

@article{turok2024sampling,
  title={Sampling From Multiscale Densities With Delayed Rejection Generalized Hamiltonian Monte Carlo},
  author={Turok, Gilad and Modi, Chirag and Carpenter, Bob},
  journal={arXiv preprint arXiv:2406.02741},
  year={2024}
}

Resources 📚

Relevant Papers

Background papers

Visualization

Hamiltonian Monte Carlo sampling from a 2-dimensional banana-shaped distribution:

hmc sampler

About

[NeurIPS 2024] Sampling From Multiscale Densities With Delayed Rejection Generalized Hamiltonian Monte Carlo.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages

  • Jupyter Notebook 96.9%
  • C++ 1.6%
  • Python 1.5%