Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Data generator for hierarchically modeling strongly-lensed systems with Bayesian neural networks

Project description


Build Status Documentation Status

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


  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
cd baobab
pip install -e .

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

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


  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/ my_config_collection/
  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/

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/ 100

Please message @jiwoncpark with any questions.

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

Project details

Download files

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

Files for pybaobab, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size pybaobab-0.1.0-py3-none-any.whl (534.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pybaobab-0.1.0.tar.gz (529.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page