Skip to content


Repository files navigation


Code for the paper: Score Matched Neural Exponential Families for Likelihood-Free Inference, which can be found here.


All experiments and plots from the paper can be reproduced using the code provided here. Notice however that some scripts are computationally intensive and may need to be run on a parallel cluster (specifically those performing ABC, SL and RE inference).

The content of this repository is as follows:

  • src contains source code for performing NN training and inference
  • scripts contains Python scripts to run the different experiments
  • plot_scripts contains Python scripts to reproduce the figures starting from results
  • tests contains some tests for our source code; see below

Reproducing the experiments

We provide bash scripts calling the Python scripts with the options we used in the paper and in the right order.

For instance, in order to run the experiments on the beta model, it suffices to do:

chmod +x  # to make it runnable 

However, it may be wiser to take the different Python commands and run them independently one by one; in fact, some of them have very different computational complexities, specifically some may require a large number of MPI tasks to run efficiently. Alternatively, you can also use GPUs to train the neural networks.


Listed in the requirements.txt file. Please install with:

pip install -r requirements.txt


We test some source code we introduce. To run them, do:

python -m unittest tests


Please use the following .bib entry:

    author  = {Lorenzo Pacchiardi and Ritabrata Dutta},
    title   = {Score Matched Neural Exponential Families for Likelihood-Free Inference},
    journal = {Journal of Machine Learning Research},
    year    = {2022},
    volume  = {23},
    number  = {38},
    pages   = {1-71},
    url     = {}


Code for the paper: "Score Matched Conditional Exponential Families for Likelihood-Free Inference",