Skip to main content

A user-friendly machine learning Bayesian inference library

Project description

![Downloads tags](https://img.shields.io/github/downloads-pre/hagabbar/vitamin_b/0.1.0/total) ![Commits](https://img.shields.io/github/commit-activity/m/hagabbar/vitamin_b) ![License](https://img.shields.io/github/license/hagabbar/vitamin_b) ![GitHub Stars](https://img.shields.io/github/stars/hagabbar/vitamin_b?style=social) ![Twitter](https://img.shields.io/twitter/follow/gw_hunter?style=social) [![Build Status](https://travis-ci.org/hagabbar/vitamin_b.svg?branch=master)](https://travis-ci.org/hagabbar/vitamin_b)

# [VItamin_B: A Machine Learning Library for Fast Gravitational Wave Posterior Generation](https://arxiv.org/abs/1909.06296) :star: Star us on GitHub — it helps!

Welcome to VItamin_B, a python toolkit for producing fast gravitational wave posterior samples.

This [repository](https://github.com/hagabbar/vitamin_b) is the official implementation of [Bayesian Parameter Estimation using Conditional Variational Autoencoders for Gravitational Wave Astronomy](https://arxiv.org/abs/1909.06296).

Hunter Gabbard, Chris Messenger, Ik Siong Heng, Francesco Tonlini, Roderick Murray-Smith

Official Documentation can be found at [https://hagabbar.github.io/vitamin_b](https://hagabbar.github.io/vitamin_b).

Check out our Blog (to be made), [Paper](https://arxiv.org/abs/1909.06296) and [Interactive Demo](https://colab.research.google.com/github/hagabbar/OzGrav_demo/blob/master/OzGrav_VItamin_demo.ipynb).

Note: This repository is a work in progress. No official release of code just yet.

## Requirements

VItamin requires python3.6. You may use python3.6 by initializing a virtual environment.

` virtualenv -p python3.6 myenv source myenv/bin/activate pip install --upgrade pip `

Make sure to install basemap prior to installing all other packages.

For installing basemap: - Install geos-3.3.3 from source - Once geos is installed, install basemap using pip install git+https://github.com/matplotlib/basemap.git

For other required packages: ` pip install -r requirements.txt `

Install VItamin using pip: ` pip install vitamin-b `

## Training

To train an example model from the paper, try out the [demo](https://colab.research.google.com/github/hagabbar/OzGrav_demo/blob/master/OzGrav_VItamin_demo.ipynb).

Full model definitions are given in models directory. Data is generated from gen_benchmark_pe.py.

## Results

We train using a network derived from first principals: ![](images/network_setup.png)

We track the performance of the model during training via loss curves: ![](images/inv_losses_log.png)

Finally, we produce posteriors after training and other diagnostic tests comparing our approach with 4 other independent methods:

Posterior example: ![](images/corner_testcase0.png)

KL-Divergence between posteriors: ![](images/hist-kl.png)

PP Tests: ![](images/latest_pp_plot.png)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vitamin_b-0.2.0.tar.gz (58.5 kB view details)

Uploaded Source

Built Distribution

vitamin_b-0.2.0-py2.py3-none-any.whl (68.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file vitamin_b-0.2.0.tar.gz.

File metadata

  • Download URL: vitamin_b-0.2.0.tar.gz
  • Upload date:
  • Size: 58.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.8

File hashes

Hashes for vitamin_b-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6e9aca68b231fec9bc1c47d099ac6e3532bc416d00b0815bae30e712cb9f8e7e
MD5 e89b7ecf941c56b94e6ceea21ac53b8e
BLAKE2b-256 9ad8083734771105cdcf7d5dcda334db5b0bc58035cc17043e464bac68e7fba7

See more details on using hashes here.

File details

Details for the file vitamin_b-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: vitamin_b-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 68.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.8

File hashes

Hashes for vitamin_b-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7d35e67db8bee82bd13d8d475b7a100e6a9b2e1b196f0757d17cf24dc1b0d9f2
MD5 7f754fb99e214afe8b8a7f6666503915
BLAKE2b-256 08f15466d56454d610d6277952c18bfe3293a1053bc9a38c4e91b835caa720ce

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page