Code Monkey home page Code Monkey logo

ovejero's Introduction

ovejero - Bayesian Neural Network Inference of Strong Gravitational Lenses

image

Documentation Status

image

image

image

image

ovejero conducts hierarchical inference of strongly-lensed systems with Bayesian neural networks

Installation

Lenstronomy requires an additional fortran package (fastell) to run lens models with elliptical mass distributions. Thankfully, installing the package is fairly easy (although a fortran compiler is required).

$ git clone https://github.com/sibirrer/fastell4py.git <desired location>
$ cd <desired location>
$ python setup.py install --user

In the future, ovejero will be a pypi package. For now, it can be installed by cloning the git repo.

$ git clone https://github.com/swagnercarena/ovejero.git
$ cd overjero/
$ pip install -e . -r requirements.txt

The addition of the -e option will allow you to pull ovejero updates and have them work automatically.

Main Features

  • Ability to train Bayesian Neural Networks (BNNs) to predict posteriors on strong gravitational lensing images
  • Integration with forward modeling tools in lenstronomy to allow comparison between BNN outputs and more traditional methods
  • Hierarchical Inference tools that allow for population parameter estimates and unbiased posteriors on independent test sets

Demos

The jupyter notebooks in the demos folder walk you through how to use all the main features of the ovejero package.

Datasets, Chains, Model Weights, and Paper Figures

To reproduce all of the figures (and results) of "Hierarchical Inference With Bayesian Neural Networks: An Application to Strong Gravitational Lensing" you can download the datasets, chains, model weights, and BNN samples from zenodo.

If you simply want to run the notebooks in the ovejero/paper folder (and therefore reproduce all the figures of the paper) you will need to download and unzip the following files:

  • datasets.zip
  • forward_modeling.zip
  • hierarchical_results.zip
  • validation_results.zip

The contents of theses files will have to be placed in <ovejero_root_path>/<folder_name> for the notebooks to find the data. For example, for datasets.zip, the contents will need to be placed in $ovejero/datasets.

This list does not include the model weights or the training dataset, since neither are needed to generate the plots (the BNN samples are saved to avoid needing a GPU to generate plots quickly). The BNN weights and training dataset can also be downloaded from the zenodo dataset:

  • train.zip
  • models.zip

Attribution

If you use ovejero or its datasets for your own research, please cite the lenstronomy package (Birrer & Amara 2018), the lens simulation package baobab (Park et al. 2020), and the BNN package ovejero (Wagner-Carena et al. 2020).

ovejero's People

Contributors

bsorsch avatar swagnercarena 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.