This repository contains all of the code and generated data used for the simulation study section of the paper "Sampling on Discrete Spaces with Temporal Point Processes". For reproducibility purposes, the random seeds set in the files are the same seeds used in the simulation study.
⚠️ Be aware that reproducing all 3,150 ESS values is likely to take weeks if done sequentially, primarily due to the extremely long runs of the stochastic processes that we commit to (10,000,000 jumps in state per run).
⌨️ If you are only interested in seeing an implementation of the point process sampler, see the
pointProcessfunction insimulation/simulation.py.
- Python (version 3.6 and above)
- NumPy
To regenerate the plots in the paper, you will also need:
- Matplotlib
- a LaTeX distribution
The code is split into three folders:
- 📂
parameter_gencontains code to generate the weights and biases used in the Sherrington-Kirkpatrick (fully-connected Ising) and stochastic neural network models.- Execute
python ising_parameter_gen.pyandpython neural_parameter_gen.pyto generate the parameter filesising_parameters.npzandneural_parameters.npzrespectively. - The generated parameter files used in the simulation study are located in the
simulationfolder.
- Execute
- 📂
simulationcontains code to run all of the simulations as described in the paper.- Execute
python simulation.py -hto see usage instructions. - The argument
rundetermines the random seed for the run. If you wish to reproduce a result used in the paper,runshould be set to an integer from0to9. - Variations in floating-point arithmetic implementations between machines may cause extremely small differences in reproduced ESS values. Reproducing CPU time is not expected.
- The data generated in the simulation study is located in the
plot/datafolder.
- Execute
- 📂
plotcontains code to reproduce the plots in the paper.- Execute
python plot.pyto reproduce theplots.epsgraphic displayed in the paper, using data from the 315 CSV files inplot/data. - The filenames in
plot/datatake the formsampler_model_scale.csv, wherescaleis a float corresponding to the horizontal axis of the plots ($\Lambda$ ,$\beta$ , or$\alpha$ ). - Each CSV file contains ten rows and two columns. Each row corresponds to one of the ten runs made for each sampler and distribution pair. The first column reports ESS. The second column reports CPU time in seconds.
- Execute
To regenerate one of the rows in plot/data/point_poisson_0.1.csv execute
python simulation.py point poisson 0.1 <run>
where <run> is an integer from 0 to 9. The ordering of the rows in each CSV file does not necessarily correspond to the value of <run>.