Skip to main content

Deep Learning for Bayesian Inference (DL4BI)

Project description

Deep Learning for Bayesian Inference (dl4bi)

Install

Install with the appropriate command. If JAX isn't installed already, we recommend using one of the dl4bi[<jax-version>] installs.

pip install dl4bi # dl4bi
pip install dl4bi[cpu] # dl4bi + jax for CPU
pip install dl4bi[cuda12] # dl4bi + jax for CUDA-12
pip install dl4bi[cuda13] # dl4bi + jax for CUDA-13
pip install dl4bi[benchmarks,cpu] # benchmark deps + jax for CPU
pip install dl4bi[benchmarks,cuda12] # benchmark deps + jax for CUDA-12
pip install dl4bi[benchmarks,cuda13] # benchmark deps + jax for CUDA-13

The benchmarks extra installs the additional packages used by the benchmark scripts, especially under benchmarks/meta_learning and benchmarks/vae.

View Documentation (Locally)

git clone git@github.com:MLGlobalHealth/dl4bi.git
cd dl4bi
uv run --with pdoc pdoc --docformat google --math dl4bi

Cite

If you're using this package or some of its code, please cite the relevant paper(s):

@inproceedings{jenson2026scalable,
  title = {Scalable Spatiotemporal Inference with Biased Scan Attention Transformer Neural Processes},
  author = {Jenson, Daniel and Navott, Jhonathan and Grynfelder, Piotr and Zhang, Mengyan and Sharma, Makkunda and Semenova, Elizaveta and Flaxman, Seth},
  booktitle = {Proceedings of the 29th International Conference on Artificial Intelligence and Statistics},
  series = {Proceedings of Machine Learning Research},
  volume = {300},
  address = {Tangier, Morocco},
  year = {2026},
  publisher = {PMLR}
}

@inproceedings{navott2026deeprv,
  title = {{DeepRV}: Accelerating Spatiotemporal Inference with Pre-trained Neural Priors},
  author = {Navott, Jhonathan and Jenson, Daniel and Flaxman, Seth and Semenova, Elizaveta},
  booktitle = {Proceedings of the 29th International Conference on Artificial Intelligence and Statistics},
  series = {Proceedings of Machine Learning Research},
  volume = {300},
  address = {Tangier, Morocco},
  year = {2026},
  publisher = {PMLR}
}

Benchmarks are available for BSA-TNP here and for DeepRV here.

Development Setup

  • Install uv: curl -LsSf https://astral.sh/uv/install.sh | sh
  • Clone the repository and cd into it: git clone git@github.com:MLGlobalHealth/dl4bi.git && cd dl4bi
  • Install the latest Python with uv: uv python install
  • Sync the project environment:
    • CPU JAX: uv sync --extra cpu
    • CUDA 12 JAX: uv sync --extra cuda12
    • CUDA 13 JAX: uv sync --extra cuda13
    • Benchmark deps + CPU JAX: uv sync --extra benchmarks --extra cpu
    • Benchmark deps + CUDA 12 JAX: uv sync --extra benchmarks --extra cuda12
    • Benchmark deps + CUDA 13 JAX: uv sync --extra benchmarks --extra cuda13
  • uv sync creates .venv, installs the project in editable mode, includes the default dev dependency group, and picks a Python interpreter compatible with the project's requires-python
  • Before making changes, install the shared development hooks: uv run pre-commit install --install-hooks
  • Verify the hook setup once per clone with: uv run pre-commit run --all-files
  • Keep the hooks installed for local development; commits on main run pytest -q tests through the shared pre-commit setup
  • Run project commands through uv, e.g. uv run pytest or uv run python gp.py
  • If you want to activate the virtualenv directly, use source .venv/bin/activate

Build and Publish to PyPI

Create a local .env file with the publish tokens:

TEST_PYPI_TOKEN=pypi-...
PYPI_TOKEN=pypi-...

Run the release helper from a clean main checkout:

uv run python scripts/release.py .env "AISTATS 2026"

The helper bumps the patch version, commits and tags v<version> <message>, rebuilds dist/, publishes to TestPyPI and PyPI, pushes main and the tag, and smoke-tests the published install targets.

Project details


Download files

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

Source Distribution

dl4bi-0.1.3.tar.gz (30.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dl4bi-0.1.3-py3-none-any.whl (96.3 kB view details)

Uploaded Python 3

File details

Details for the file dl4bi-0.1.3.tar.gz.

File metadata

  • Download URL: dl4bi-0.1.3.tar.gz
  • Upload date:
  • Size: 30.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Void","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dl4bi-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c155b5621fbde6372997da3e9dbdc3779787a6ef388c40c99875e771ddd47c54
MD5 61839713f18613d848ea35a5f75eb709
BLAKE2b-256 1f07121e5d37a14ffffa0c30fa5c9c7d5bd1f2368549d8fe65d633dd61393dad

See more details on using hashes here.

File details

Details for the file dl4bi-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: dl4bi-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 96.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Void","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dl4bi-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 51b39f5a543c0e319adf3b23065becf28adc6459c3b407102d93192ad2a845e3
MD5 ef21b6bf5f90ea33d7db355d2307d38e
BLAKE2b-256 dda084d7e59336e43b52726b00c3fff8f6ac22e9af139e35d68bff343eef47d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page