Coder Social home page Coder Social logo

dirmeier / ssnl Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 59 KB

Simulation-based inference using SSNL

License: Apache License 2.0

Python 100.00%
approximate-bayesian-computation approximate-inference bayesian-inference jax normalizing-flows simulation-based-inference

ssnl's Introduction

SSNL

This repository contains code to run the experiments from Simulation-based inference using surjective sequential neural likelihood estimation.

Installation

Install miniconda 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>

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

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:

python compute_mmd.py \
  results/slcp \
  results/slcp/slcp-nuts-exact-posteriors.pkl \
  results/slcp/slcp-df.pkl

ssnl's People

Contributors

dirmeier avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.