Code Monkey home page Code Monkey logo

sgl_bay_nn's Introduction

baobab

Build Status Documentation Status

Training data generator for hierarchically modeling strong lenses with Bayesian neural networks

Installation

  1. You'll need a Fortran compiler, which you can get on a debian system by running
sudo apt-get install gfortran
  1. Virtual environments are strongly recommended, to prevent dependencies with conflicting versions. Create a conda virtual environment and activate it.
conda create -n baobab python=3.6 -y
conda activate baobab
  1. Now do one of the following.

Option 2(a): clone the repo (please do this if you'd like to contribute to the development).

git clone https://github.com/jiwoncpark/baobab.git
cd baobab
pip install -e .

Option 2(b): pip install the release version (only recommended if you're a user).

pip install pybaobab
  1. (Optional) To run the notebooks, add the Jupyter kernel.
python -m ipykernel install --user --name baobab --display-name "Python (baobab)"

Usage

  1. Choose your favorite config file among the templates in the configs directory and copy it to a directory of your choice, e.g.
mkdir my_config_collection
cp baobab/configs/tdlmc_diagonal_config.py my_config_collection/my_config.py
  1. Customize it! You might want to change the name field first with something recognizable. Pay special attention to the components field, which determines which components of the lensed system (e.g. lens light, AGN light) become sampled from relevant priors and rendered in the image.

  2. Generate the training set, e.g. continuing with the example in #1,

generate my_config_collection/my_config.py

Although the n_data (size of training set) value is specified in the config file, you may choose to override it in the command line, as in

generate my_config_collection/my_config.py --n_data 100

Alternatively, you can run

python -m baobab.generate my_config_collection/my_config.py --n_data 100

Please message @jiwoncpark with any questions.

There is an ongoing document that details our BNN prior choice, written and maintained by Ji Won.

sgl_bay_nn's People

Contributors

jiwoncpark avatar

Watchers

Reaves 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.