Written by Giulio Isacchini, MPIDS Göttingen - ENS Paris and Natanael Spisak, ENS Paris
The code is written in Python3. Last updated on 24-05-2021
Reference: MINIMALIST: Mutual INformatIon Maximization for Amortized Likelihood Inference from Sampled Trajectories, Giulio Isacchini, Natanael Spisak, Armita Nourmohammad, Thierry Mora and Aleksandra M. Walczak
In order to reproduce the plots you need to run the following commands.
- Install the
mimsbi
package
Enter the mimsbi folder and run the command python setup.py install
- Run analysis
To run the analysis for the the 4 task run the script run_analysis.py
with the options: ou
,bd
,sir
and/or lorenz
.
- Plot the results.
For Figure 2, run fig2.py
For Figure 3 run fig3.py
For Figure 4, run fig4.py
This directory includes a stable version of the mimsbi
package.
The package allows to infer the likelihood-to-evidence ratio model using one of three objective functions: MINE, FDIV or BCE. The package has implemented simulators for the processes studied in the MINIMALIST paper: Ornstein-Uhlenbeck, birth-death, SIR and Lorenz processes. To add another functionality one needs to add a new Simulator
class to mimsbi/models
. Then, inference can be performed using the DensityRatioEstimator
class. For example of usage go to the scripts
directory where separate files can be used to
- simulate the data
scripts/simulate.py
- tune network hyperparameters
scripts/infer_hyperpars.py
- likelihood-to-evidence ratio inference
scripts/infer_estimators.py
- posterior evaluation
scripts/compare_estimators.py
To use the above scripts with a new model, its specifications need to be added in scripts/utils.py
return_pars
function. A simple data generation to posterior evaluation protocol is also available in the mimsbi/tutorial.ipynb
Jupyter notebook.
tensorflow>2.1
numpy
pandas
scipy
matplotlib
tqdm