We introduce a library called PusH (particle pushforward) that enables a probabilistic programming approach to Bayesian deep learning (BDL).
- Models are defined by wrapping ordinary
PyTorch
neural networks. Each particle corresponds to a point estimate. A collection of particles approximates a distributional estimate. - Inference procedures are defined as concurrent procedures on particles via message-passing.
- Primary use case is BDL.
https://lbai-push.readthedocs.io/en/latest/
Currently PusH can only be installed from source.
Pip installation is under development.
- Create and activate isolated Python environment
conda create -n push_env python=3.10
conda activate push_env
- Locally install PusH in project root.
pip install -e .
This will install PusH and its dependencies
3. OPTIONAL: Install requirements
To run any of the experiments in the experiments
folder, additional packages are necessary.
pip install pytz wandb matplotlib pandas torch torch_geometric torch_vision h5py pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+cu118.html
- Install
push
and its dependencies following installation. - Run some basic tests for various BDL algorithms to test installation.
./run_tests.sh
- Also experiment with:
python ./test/test_basic.py -m ensemble
python ./test/test_basic.py -m mswag
python ./test/test_basic.py -m stein_vgd
Add your own BDL algorithms in /push/bayes
by extending the Infer
class.
Deep Ensembles, MultiSWAG, and Stein Variational Gradient Descent are implemented as examples.
- See
./experiments/README.md
for more details.