Training data generator for hierarchically modeling strong lenses with Bayesian neural networks
- You'll need a Fortran compiler, which you can get on a debian system by running
sudo apt-get install gfortran
- 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
- Now do one of the following.
git clone https://github.com/jiwoncpark/baobab.git
cd baobab
pip install -e .
pip install pybaobab
- (Optional) To run the notebooks, add the Jupyter kernel.
python -m ipykernel install --user --name baobab --display-name "Python (baobab)"
- 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
-
Customize it! You might want to change the
name
field first with something recognizable. Pay special attention to thecomponents
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. -
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.