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

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
  • 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.2.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.2-py3-none-any.whl (96.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dl4bi-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 262d49fe4b11f530dbd77cac71b01ec4092d326c5e515eb804a09fdab4eaacb5
MD5 54118f6a172ef161172ec65490b63dc3
BLAKE2b-256 a7d51615218f48ff32f8e223aa9c6b7d623c6d3ac99ae77814ccbe3eacd55e87

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dl4bi-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 96.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7a212ed705d7b39c4edd1d7a87712c0980d0840ae02680134d69e7bf5ba3721c
MD5 e01b30690187b27536b61c32de70e1db
BLAKE2b-256 b77a8853585ac3bb300e1c35e42f07b68c0a41388a2327e56eae3937480a7bcf

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