https://github.com/dirmeier/ssnl
Simulation-based inference using SSNL
https://github.com/dirmeier/ssnl
approximate-bayesian-computation approximate-inference bayesian-inference jax normalizing-flows simulation-based-inference
Last synced: 3 months ago
JSON representation
Simulation-based inference using SSNL
- Host: GitHub
- URL: https://github.com/dirmeier/ssnl
- Owner: dirmeier
- License: apache-2.0
- Created: 2023-04-19T13:20:59.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-02T11:23:53.000Z (almost 2 years ago)
- Last Synced: 2025-01-17T06:45:47.059Z (4 months ago)
- Topics: approximate-bayesian-computation, approximate-inference, bayesian-inference, jax, normalizing-flows, simulation-based-inference
- Language: Python
- Homepage:
- Size: 57.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SSNL
This repository contains code to run the experiments from
*Simulation-based inference using surjective sequential neural likelihood estimation*.## Installation
Install [miniconda](https://docs.conda.io/en/latest/miniconda.html) and create an environment using the
environment file `environment.yaml`. This should install all required dependencies.## Usage
To run an experiment load the environment and then executre>
```bash
python main.py \
--outdir=results/ \
--mode=fit \
--config=configs/slcp/surjection.py \
--config.training.n_rounds=${n_rounds} \
--config.rng_seq_key=${key}
```This generates a file that contains trained neural network parameters. To get posterior samples, run
```bash
python main.py \
--outdir=results/ \
--mode=eval \
--checkpoint=results/slcp-params.pkl \
--config=configs/slcp/surjection.py \
--round=${rounds} \
--config.rng_seq_key=${key}
```To compute the MMD between the true and the approximate posterior samples execute:
```bash
python compute_mmd.py \
results/slcp \
results/slcp/slcp-nuts-exact-posteriors.pkl \
results/slcp/slcp-df.pkl
```