Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mackelab/gatsbi
GATSBI: Generative Adversarial Training for Simulation-Based Inference
https://github.com/mackelab/gatsbi
Last synced: 14 days ago
JSON representation
GATSBI: Generative Adversarial Training for Simulation-Based Inference
- Host: GitHub
- URL: https://github.com/mackelab/gatsbi
- Owner: mackelab
- License: agpl-3.0
- Created: 2022-01-30T15:05:00.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-13T13:35:27.000Z (over 1 year ago)
- Last Synced: 2024-08-01T16:52:36.000Z (3 months ago)
- Language: Python
- Size: 15.3 MB
- Stars: 17
- Watchers: 8
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GATSBI: Generative Adversarial Training for Simulation-Based Inference
---
Code package `gatsbi` implementing method and experiments described in the associated manuscript ["GATSBI: Generative Adversarial Training for Simulation-Based Inference"](https://openreview.net/forum?id=kR1hC6j48Tp&referrer=%5BAuthor%20Console%5D(%2Fgroup%3Fid%3DICLR.cc%2F2022%2FConference%2FAuthors%23your-submissions))The code depends both on the simulation-based inference package [`sbi`](https://github.com/mackelab/sbi) and the benchmark framework [`sbibm`](https://github.com/mackelab/sbibm).
___
### InstallationWith a working Python environment, install `gatsbi` using `pip`:
```
pip install "git+https://github.com/mackelab/gatsbi"
```
___
### Mininmal exampleFor a minimal demonstration of how to use `gatsbi` see `quickstart.ipynb`.
___
### ExperimentsThe paper describes results for the following experiments: 2 benchmark tasks, the shallow water model, and a noisy camera model.
Code for setting up priors, simulator, GAN networks and any other pre-/post-processing code is available inside `gatsbi.task_utils`.
Hyperparameter settings for each of the experiments are available in `tasks/`
To reproduce the exact experiments described in the paper, use the following run_scripts from the repository's root directory (note that this relies on `wandb` to log experiments)
- `run_benchmarks.py` for benchmark tasks
```
python run_benchmarks.py --project_name="Benchmarks" --task_name="two_moons"
```
`task_name` = `slcp` or `two_moons` for amortized GATSBI, `slcp_seq` or `two_moons_seq` for sequential GATSBI.
- `run_highdim_applications.py` for high dimensional tasks
```
python run_highdim_applications.py --project_name="High Dimensional Applications" --task_name="shallow_water_model"
```
`task_name` = `shallow_water_model` or `camera_model`.
- `run_inference_nle/npe/nre.py` for running NPE / NLE / NRE on shallow water model.
```
python run_inference_nle/npe/nre.py
```
Note that we **do not** provide training data for the shallow water model in this repository. Please use `sample_shallow_water.py` to generate training samples locally.
___
### FiguresCode to reproduce the figures in the paper is available in `plotting_code`, along with the required data `plotting_code/plotting_data`, and the final plots `plotting_code/plots`. Note that accessing the data requires Git LFS installation.