fusions
Diffusion meets (nested) sampling
A miniminal implementation of diffusion models in JAX (Flax). Tuned for usage in building emulators for scientific models, particularly where MCMC sampling is tractable and used.
Quickstart
Install fusions and lsbi from pypi
pip install lsbi fusions
create a 5D sampling problem then train a flow matched model to approximate the posterior
from fusions.cfm import CFM
from lsbi.model import MixtureModel
from anesthetic import MCMCSamples
import matplotlib.pyplot as plt
import numpy as np
dims = 5
Model = MixtureModel(
M=np.stack([np.eye(dims), -np.eye(dims)]),
C=np.eye(dims)*0.1,
)
data = Model.evidence().rvs()
diffusion = CFM(Model.prior())
# diffusion = CFM(dims)
diffusion.train(Model.posterior(data).rvs(1000))
a = MCMCSamples(Model.posterior(data).rvs(500)).plot_2d(np.arange(dims))
MCMCSamples(diffusion.rvs(500)).plot_2d(a)
plt.show()
Metadata
Release files for fusions 0.4.3
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 |
|---|---|---|---|---|
| fusions-0.4.3.tar.gz | 14.8 kB | Without provenance | Details for fusions-0.4.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fusions-0.4.3-py3-none-any.whl | Python 3 | none | any | Details for fusions-0.4.3-py3-none-any.whl |
Total release size: 32.3 kB
Release files / fusions-0.4.3.tar.gz
| Download URL | fusions-0.4.3.tar.gz |
|---|---|
| Size | 14.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7c523ed4b98e6693ba65e9e59a5a0df2eb09c8cde35e11154df901391edbabe5
|
|
BLAKE2b-256 checksum How to use checksums |
a2e9f57bc0dc1e34dada2a2e98d6850428dcf76c8868ccab6f1efa9f9620ce70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Release files / fusions-0.4.3-py3-none-any.whl
| Download URL | fusions-0.4.3-py3-none-any.whl |
|---|---|
| Size | 17.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6ef3cd52e5eda6c0f350c67913041703ce20f1a8c6f07d6fc6207f651c7b4aa6
|
|
BLAKE2b-256 checksum How to use checksums |
69ba548f64128921cb392f013f1c81c791b2bc22541668cf2ed99bedbf1d67f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Security for fusions 0.4.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.