Code to reproduce the toy experiments illustrated in the Proper Value Equivalence paper.
Requires python >= 3.8
git clone git@github.com:chrisgrimm/proper_value_equivalence.git && \
cd proper_value_equivalence && \
mkdir visuals && \
python3.8 -m venv venv && \
source venv/bin/activate && \
pip install -r requirements.txtAlso requires a system installation of latex
sudo apt install texlive texlive-latex-extra texlive-fonts-recommended dvipng cm-super && \
pip install latexTo generate the toy plots described in the paper one must first generate data using the main.py file and then visualize that data using the experiment_visualizations.ipynb notebook.
The syntax for running the main.py file is as follows:
python main.py <experiment_type> <data_directory> <random_seed>
where experiment_type is either diameter or capacity, data_directory is a folder where the data will be written to and random_seed is the seed for jax and numpy.
To generate all data needed for the visualizations of toy experiments, run the following two commands (this may take a while):
python main.py diameter . 1234python main.py capacity . 1234When these commands are completed there will be two new directories ray_diameter and ray_capacity with the following structure
.
├── ray_diameter
│ └── run_experiment_XXXX # Load and stress tests
└── ray_capacity
└── run_experiment_YYYYwhere XXXX and YYYY are replaced with date/time information corresponding to when you ran the experiment.
To visualize the data, start up the Jupyter notebook by running
jupyter notebookthen open experiment_visualizations.ipynb in your browser.
There is a cell labeled Data loading configuration which has three values to specify: RAY_DIR, CAPACITY_EXPERIMENT_DIRS and DIAMETER_EXPERIMENT_DIRS. Set RAY_DIR=., CAPACITY_EXPERIMENT_DIRS=YYYY and DIAMETER_EXPERIMENT_DIRS=XXXX where XXXX and YYYY are defined in the previous section.
This will save the plots in a folder ./visuals/