A unified interface for probabilistic inference in JAX + Equinox
Project description
Inferix: A unified interface for probabilistic inference in JAX + Equinox
| Inferix | |
|---|---|
| Author | Gary Allen |
| Homepage | github.com/gvcallen/inferix |
Installation
Inferix can be installed using pip directly:
pip install inferix
Motivation
In the JAX ecosystem, you typically have to choose between two extremes for Bayesian inference:
- Wrappers around lower-level drivers (like BlackJAX or PolyChord), which force you to manually manage while-loops, PRNG keys, buffers, and algorithmic states.
- High-level Probabilistic Programming Languages (PPLs) (like NumPyro or PyMC), which are user-friendly but force you to rewrite your models using their specific domain-specific languages and distribution primitives.
The goal of Inferix is to be a middle option that mirrors the API of Optimistix. It is designed for engineers and scientists who already have a forward model written in pure JAX, and just want to sample from it without managing boilerplate or adopting a heavy PPL framework.
Inferix wraps low-level algorithms in a unified interface (inferix.mcmc_sample or inferix.nested_sample) and handles any host-bridge, XLA-compiled control flow, reparameterizations and data packaging. Current kernels include JAX-native NUTS and Nested Slice Sampling (via BlackJAX), and a host-bridged PolyChord.
import jax
import jax.numpy as jnp
import inferix
# 1. Define your target functions (Pure JAX)
def my_likelihood(theta, args):
# e.g., A complex differentiable physics simulation
return ...
def my_prior_transform(u, args):
# A mapping from the uniform unit hypercube coordinates u to physical parameters theta
return ...
# 2. Instantiate your sampler of choice e.g. inferix.NUTS, inferix.NSS or inferix.PolyChord
sampler = inferix.NSS(num_delete=10, num_inner_steps=20)
# 3. Execute the run
key = jax.random.PRNGKey(42)
result = inferix.nested_sample(
log_likelihood_fn=my_likelihood,
prior_transform_fn=my_prior_transform,
sampler=sampler,
ndims=5,
key=key,
logZ_convergence=1e-3,
)
# 4. Access the results
print(f"Final log-Evidence (logZ): {result.logZ} ± {result.logZ_err}")
print(f"Num samples: {result.samples.shape[0]}")
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
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
File details
Details for the file inferix-0.1.3.tar.gz.
File metadata
- Download URL: inferix-0.1.3.tar.gz
- Upload date:
- Size: 3.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08bcfd0f928b052d607ed064cfb5646ab453e3144f73484d419672fc053ad392
|
|
| MD5 |
88ad40c29fb47d3befe656a62a443903
|
|
| BLAKE2b-256 |
3843595d776dec7b76ab7fed452dd7b25f56120b93452e64da1b6627892df730
|
Provenance
The following attestation bundles were made for inferix-0.1.3.tar.gz:
Publisher:
publish.yml on gvcallen/inferix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inferix-0.1.3.tar.gz -
Subject digest:
08bcfd0f928b052d607ed064cfb5646ab453e3144f73484d419672fc053ad392 - Sigstore transparency entry: 1132576320
- Sigstore integration time:
-
Permalink:
gvcallen/inferix@ea83de73d5300f57f35f9758cd43808821a48665 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/gvcallen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ea83de73d5300f57f35f9758cd43808821a48665 -
Trigger Event:
push
-
Statement type:
File details
Details for the file inferix-0.1.3-py3-none-any.whl.
File metadata
- Download URL: inferix-0.1.3-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9829cb4569a904f99453af0eb09676b70c77265cbb4f2c007cf73947950d1fc
|
|
| MD5 |
b20bc56e7b28b8f46b7daf5b4791eab6
|
|
| BLAKE2b-256 |
cf78d8ecde14a950d0b88c55d2be1910f17692742c7e5f69ada916d3b4e13257
|
Provenance
The following attestation bundles were made for inferix-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on gvcallen/inferix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inferix-0.1.3-py3-none-any.whl -
Subject digest:
f9829cb4569a904f99453af0eb09676b70c77265cbb4f2c007cf73947950d1fc - Sigstore transparency entry: 1132576413
- Sigstore integration time:
-
Permalink:
gvcallen/inferix@ea83de73d5300f57f35f9758cd43808821a48665 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/gvcallen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ea83de73d5300f57f35f9758cd43808821a48665 -
Trigger Event:
push
-
Statement type: