Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.49 KB

File metadata and controls

45 lines (34 loc) · 1.49 KB

This repository contains code to replicate the experiments of the paper On Consistent Bayesian Inference from Synthetic Data.

Installing Dependencies

conda env create
conda activate bayes-downstream-env

NAPSU-MQ Source

Most of the code in lib/ is from our NAPSU-MQ implementation (Räisä et al. 2023).

A more user-friendly version of the core algorithm is available in the Twinify library.

DP-GLM

The DP-GLM baseline uses code from Kulkarni et al. The code is not public, so we could not include it in the repo.

Running the Code

The Gaussian example is in the notebook bayesian-inference-gaussian-test.ipynb.

For the toy data and UCI Adult experiments, we use Snakemake. The experiments can be run with

snakemake -j 16

which uses 16 cores in parallel. After the command finishes, the plotting notebooks workflow/scripts/toy-data/report.py.ipynb can and workflow/scripts/adult-reduced/report.py.ipynb be run to plot the results.

Note: running this will likely take several days on a single computer. You can edit the snakefiles in workflow/rules to run a subset of the experiments.

Figures are saved in the figures/ directory, and separated into subdirectories of each example.