This is the official implementation of LEAPS: A discrete neural sampler via locally equivariant neural networks, a work by Peter Holderrieth*, Michael S. Albergo*, and Tommi S. Jaakkola.
conda env create -f environment.yml
-
Edit configs: Edit the configs in
ymls/ising_config.ymlorymls/potts_config.ymlto account for the filepaths on your server, i.e. changecode_path,ckpts_dirandresults_path. -
Run commands: Run code with the following commands:
python main.py --yml=ymls/ising_config.yml
python main.py --yml=ymls/potts_config.yml
To run experiments on a different energy model, you need to define an annealing path src/modules/rhot.py for the Ising model and the Potts model as guiding examples.
We provide two model checkpoints for the two Boltzmann distributions we studied:
- Ising model at critical temperature:
ckpts/ising_final.ckpt - Potts model at critical temperature:
ckpts/potts_final.ckpt
We have two notebooks that illustrate how to load models and evaluate their ESS:
notebooks/load_ising_network.ipynbnotebooks/load_potts_network.ipynb
In our work, we benchmarked against MCMC samplers using the DISCS benchmark. To replicate these experiments, perform the following steps:
- Go to DISCS repo and clone it.
- Add the model configs in
discs_configs/that you can find in this repo as a new model config to the DISCS benchmark indiscs/models/configs/within the DISCS repo. - Copy the scripts
discs_configs/isingcritical_run_discs_benchmark.shordiscs_configs/pottscritical_run_discs_benchmark.shto the DISCS repo. - Run the scripts.

