Skip to content

Latest commit

 

History

History
117 lines (78 loc) · 5.13 KB

README.md

File metadata and controls

117 lines (78 loc) · 5.13 KB

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