Skip to main content

Framework for training MCMC samplers for Lattice QCD

Project description

l2hmc-qcd

hits
l2hmc-qcd codefactor
arxiv arxiv
hydra pyTorch tensorflow
Weights & Biases monitoring

Contents

Overview

Papers 📚, Slides 📊, etc.

Background

The L2HMC algorithm aims to improve upon HMC by optimizing a carefully chosen loss function which is designed to minimize autocorrelations within the Markov Chain, thereby improving the efficiency of the sampler.

A detailed description of the original L2HMC algorithm can be found in the paper:

Generalizing Hamiltonian Monte Carlo with Neural Network

with implementation available at brain-research/l2hmc/ by Daniel Levy, Matt D. Hoffman and Jascha Sohl-Dickstein.

Broadly, given an analytically described target distribution, π(x), L2HMC provides a statistically exact sampler that:

  • Quickly converges to the target distribution (fast burn-in).
  • Quickly produces uncorrelated samples (fast mixing).
  • Is able to efficiently mix between energy levels.
  • Is capable of traversing low-density zones to mix between modes (often difficult for generic HMC).

Installation

$ python3 -m pip install l2hmc

Training

This project uses hydra for configuration management and supports distributed training for both PyTorch and TensorFlow.

The l2hmc/conf/config.yaml contains a brief explanation of each of the various parameter options, and values can be overriden either by modifying the config.yaml file, or directly through the command line, e.g.

cd src/l2hmc
./train.sh mode=debug framework=pytorch > train.log 2>&1 &
tail -f train.log $(tail -1 logs/latest)

for more information on how this works I encourage you to read Hydra's Documentation Page.

Details

L2HMC for LatticeQCD

Goal: Use L2HMC to efficiently generate gauge configurations for calculating observables in lattice QCD.

A detailed description of the (ongoing) work to apply this algorithm to simulations in lattice QCD (specifically, a 2D U(1) lattice gauge theory model) can be found in arXiv:2105.03418.

l2hmc-qcd poster

Organization

Dynamics / Network

For a given target distribution, π(x), the Dynamics object (src/l2hmc/dynamics/) implements methods for generating proposal configurations (x' ~ π) using the generalized leapfrog update.

This generalized leapfrog update takes as input a buffer of lattice configurations x and generates a proposal configuration x' = Dynamics(x) by evolving generalized L2HMC dynamics.

Network Architecture

An illustration of the leapfrog layer updating (x, v) --> (x', v') can be seen below.

leapfrog layer

---

Contact

Code author: Sam Foreman

Pull requests and issues should be directed to: saforem2

Citation

If you use this code or found this work interesting, please cite our work along with the original paper:

@misc{foreman2021deep,
      title={Deep Learning Hamiltonian Monte Carlo}, 
      author={Sam Foreman and Xiao-Yong Jin and James C. Osborn},
      year={2021},
      eprint={2105.03418},
      archivePrefix={arXiv},
      primaryClass={hep-lat}
}
@article{levy2017generalizing,
  title={Generalizing Hamiltonian Monte Carlo with Neural Networks},
  author={Levy, Daniel and Hoffman, Matthew D. and Sohl-Dickstein, Jascha},
  journal={arXiv preprint arXiv:1711.09268},
  year={2017}
}

Acknowledgement

This research used resources of the Argonne Leadership Computing Facility, which is a DOE Office of Science User Facility supported under contract DE_AC02-06CH11357. This work describes objective technical results and analysis. Any subjective views or opinions that might be expressed in the work do not necessarily represent the views of the U.S. DOE or the United States Government.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

l2hmc-0.13.0.tar.gz (16.8 MB view details)

Uploaded Source

Built Distribution

l2hmc-0.13.0-py3-none-any.whl (11.9 MB view details)

Uploaded Python 3

File details

Details for the file l2hmc-0.13.0.tar.gz.

File metadata

  • Download URL: l2hmc-0.13.0.tar.gz
  • Upload date:
  • Size: 16.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for l2hmc-0.13.0.tar.gz
Algorithm Hash digest
SHA256 1923a936c6d82dfe8db0eb05c49208f85879206f1480b69d52aa67b5f6e43770
MD5 4f7b4923b28a8c36954dfdc0bd37d2f6
BLAKE2b-256 c9e102dc4ff1a8279d928fb7804d094273da7f6345451eacbab200aa32d13c34

See more details on using hashes here.

File details

Details for the file l2hmc-0.13.0-py3-none-any.whl.

File metadata

  • Download URL: l2hmc-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for l2hmc-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0801fc46ab70e2d04d10d9190084126ece9854c9bb1845db365324b34c7fe989
MD5 90d5a0d8c472cc690c75132bbdd6a017
BLAKE2b-256 cf789b913d120646a0dfd6b207cd56a6ec7e813a85f90f3c6685f0cc7962d2eb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page