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
Example benchmarks can be found here.
Development Setup
- Install
uv:curl -LsSf https://astral.sh/uv/install.sh | sh - Clone the repository and
cdinto 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
- CPU JAX:
uv synccreates.venv, installs the project in editable mode, includes the defaultdevdependency group, and picks a Python interpreter compatible with the project'srequires-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
mainrunpytest -q teststhrough the sharedpre-commitsetup - Run project commands through
uv, e.g.uv run pytestoruv run python gp.py - If you want to activate the virtualenv directly, use
source .venv/bin/activate
Build and Publish to PyPI
- Bump the package version:
uv version --bump patch --frozen
- Build the source distribution and wheel:
uv build --no-sources
- Publish to TestPyPI first:
UV_PUBLISH_TOKEN=$TEST_PYPI_TOKEN uv publish \
--publish-url https://test.pypi.org/legacy/ \
--check-url https://test.pypi.org/simple/
- After validating the release, publish the same artifacts to PyPI:
UV_PUBLISH_TOKEN=$PYPI_TOKEN uv publish
- Smoke-test the published install targets in fresh environments:
uv run --isolated --with "dl4bi==<version>" --no-project -- python -c "import dl4bi"
uv run --isolated --with "dl4bi[cpu]==<version>" --no-project -- python -c "import dl4bi"
uv run --isolated --with "dl4bi[cuda12]==<version>" --no-project -- python -c "import dl4bi"
uv run --isolated --with "dl4bi[cuda13]==<version>" --no-project -- python -c "import dl4bi"
Project details
Release history Release notifications | RSS feed
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.0.tar.gz
(30.4 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
dl4bi-0.1.0-py3-none-any.whl
(95.7 kB
view details)
File details
Details for the file dl4bi-0.1.0.tar.gz.
File metadata
- Download URL: dl4bi-0.1.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4b7333b4bb3827b85d81386850696822ed80593ef778358fc697d35d51e7a45
|
|
| MD5 |
99d98b82a69a5a7340b71210f771fab5
|
|
| BLAKE2b-256 |
3ab1e301d485229349adc4765950e6bae17fa11ca5b524ee5305caabf8618e8e
|
File details
Details for the file dl4bi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dl4bi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 95.7 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4552066e318775e92d92cfb0951b953870deffe3c6d50bfe7fe632e23c02ea9
|
|
| MD5 |
43f6c39bc8701892e888c454244db0de
|
|
| BLAKE2b-256 |
6be8d3dcf014e891d7316355f8751dac207d8da116bb4c3a8fe1cda1b59ccf3d
|