This release is a pre-release and may not be stable for production use.
aspire: Accelerated Sequential Posterior Inference via REuse
aspire is a framework for reusing existing posterior samples to obtain new results at a reduced cost.
Installation
aspire can be installed from PyPI using pip. By default, you need to install
one of the backends for the normalizing flows, either torch or jax.
We also recommend installing minipcn if using the smc sampler:
Torch
We recommend installing torch manually to ensure correct CPU/CUDA versions are
installed. See the PyTorch installation instructions
for more details.
pip install aspire-inference[torch,minipcn]
Jax:
We recommend install jax manually to ensure the correct GPU/CUDA versions
are installed. See the jax documentation for details
pip install aspire-inference[jax,minipcn]
Important: the name of aspire on PyPI is aspire-inference but once installed
the package can be imported and used as aspire.
Quickstart
import numpy as np
from aspire import Aspire, Samples
# Define a log-likelihood and log-prior
def log_likelihood(samples):
x = samples.x
return -0.5 * np.sum(x**2, axis=-1)
def log_prior(samples):
return -0.5 * np.sum(samples.x**2, axis=-1)
# Create the initial samples
init = Samples(np.random.normal(size=(2_000, 4)))
# Define the aspire object
aspire = Aspire(
log_likelihood=log_likelihood,
log_prior=log_prior,
dims=4,
parameters=[f"x{i}" for i in range(4)],
)
# Fit the normalizing flow
aspire.fit(init, n_epochs=20)
# Sample the posterior
posterior = aspire.sample_posterior(
sampler="smc",
n_samples=500,
sampler_kwargs=dict(n_steps=100),
)
# Plot the posterior distribution
posterior.plot_corner()
Documentation
See the documentation on ReadTheDocs.
Citation
If you use aspire in your work please cite the DOI and paper.
Metadata
Release files for aspire-inference 0.1.0a14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aspire_inference-0.1.0a14.tar.gz | 68.1 kB | With provenance | Details for aspire_inference-0.1.0a14.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aspire_inference-0.1.0a14-py3-none-any.whl | Python 3 | none | any | Details for aspire_inference-0.1.0a14-py3-none-any.whl |
Total release size: 121.3 kB
Release files / aspire_inference-0.1.0a14.tar.gz
| Download URL | aspire_inference-0.1.0a14.tar.gz |
|---|---|
| Size | 68.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0541b4657726e9799885b343d75c5c66532714f90163b2e676a31c8747cec8c
|
|
BLAKE2b-256 checksum How to use checksums |
1e18c76aaef4d62d580ad470d4b06841ce77b73a22d4bbe8ec47825019413597
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 10, 2026.
Transparency logRelease files / aspire_inference-0.1.0a14-py3-none-any.whl
| Download URL | aspire_inference-0.1.0a14-py3-none-any.whl |
|---|---|
| Size | 53.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
407537ea6532a5cbfd35fe0317b8d85b54a708dac70cd51cf2de2048956178da
|
|
BLAKE2b-256 checksum How to use checksums |
bb659512c15197cf475df88b77bc07b35ee67941b9f42b3fb988cba9f3cff2f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 10, 2026.
Transparency logSecurity for aspire-inference 0.1.0a14
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for aspire_inference-0.1.0a14.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.