Skip to content

Commit

Permalink
Merge pull request #45 from JakobRobnik/deprecation
Browse files Browse the repository at this point in the history
Deprecation
  • Loading branch information
JakobRobnik authored Feb 2, 2024
2 parents c0482d4 + 8ba7de6 commit 2eebea3
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,25 @@
# MicroCanonical Hamiltonian Monte Carlo (MCHMC)
# Microcanonical Hamiltonian Monte Carlo (MCHMC)

## Installation
For details, please refer to https://microcanonical-monte-carlo.netlify.app/.

`pip install mclmc`

## Overview

![poster](img/github_poster.png)
## Usage

This repository is currently deprecated, in favor of the implementation in Blackjax: https://blackjax-devs.github.io/sampling-book/algorithms/mclmc.html.

You can check out the tutorials:
- [getting started](notebooks/tutorials/intro_tutorial.ipynb): sampling from a standard Gaussian
- [advanced tutorial](notebooks/tutorials/advanced_tutorial.ipynb): sampling the hierarchical Stochastic Volatility model for the S&P500 returns data
A Julia implementation is also available [here](https://github.com/JaimeRZP/MicroCanonicalHMC.jl).

Julia implementation is available [here](https://github.com/JaimeRZP/MicroCanonicalHMC.jl).

The associated papers are:
- [method and benchmark tests](https://arxiv.org/abs/2212.08549)
- [formulation as a stochastic process and first application to the lattice field theory](https://arxiv.org/abs/2303.18221)
## Overview

The code is still in active development, so let us know if you encounter any issues, including bad sampling performance, and we will do our best to help you out.
You can submit a github issue or contact us at jakob_robnik@berkeley.edu .
![poster](img/github_poster.png)

## Frequently asked questions:

### How can I sample with MCHMC if my parameters have bounds?
Check out [this tutorial](notebooks/tutorials/Constraints.ipynb).

### How does cost of producing one sample in HMC compare to the cost of one sample in MCHMC?
MCHMC samples are less costly. What is relevant for the computational time is the number of gradient evaluations used. Each sample in MCHMC is two gradient evaluations (1 gradient evaluation if leapfrog integrator is used instead of minimal norm integrator). Each sample in HMC is L gradient evaluations (where L is the number of leapfrog steps per sample), which can be quite large for hard targets (in default NUTS setting up to 1024).

### Is MCHMC just some weird projection of HMC onto the constant energy surface?
No, the Hamiltonian dynamics of both methods are different (the particles move differently). Below is the motion of MCHMC particles for the Rosenbrock target distribution.


MCHMC samples are less costly. What is relevant for the computational time is the number of gradient evaluations used. Each sample in MCHMC is two gradient evaluations (1 gradient evaluation if leapfrog integrator is used instead of minimal norm integrator). Each sample in HMC is L gradient evaluations (where L is the number of leapfrog steps per sample), which can be quite large for hard targets (in default NUTS setting up to 1024).

### Is MCHMC just some projection of HMC onto the constant energy surface?

No, the Hamiltonian dynamics of both methods are different (the particles move differently). Below is the motion of MCHMC particles for the Rosenbrock target distribution.

![ensamble](img/rosenbrock.gif)

0 comments on commit 2eebea3

Please sign in to comment.