ximinf
Simulation-Based Inference of Cosmological Parameters in JAX using Type Ia Supernovae.
ximinf is a Python package for performing simulation-based inference (SBI) on cosmological parameters using type Ia supernova (SN Ia) data, built on top of JAX for fast, differentiable, and GPU/TPU-accelerated computation.
Installation
pip install ximinf
Requires Python >= 3.10.
Quickstart
import ximinf
See the documentation for full usage examples covering simulation, training, and inference.
Features
ximinf is organized into five core modules:
ximinf.generate_sim— Generates simulated SN Ia datasets. Includes Latin Hypercube Sampling (LHS) of cosmological/nuisance parameters under configurable priors (uniform, gaussian, half-gaussian, log-uniform, exponential, etc.), and per-dataset simulation viaskysurvey.ximinf.selection_effects— Tools for injecting realistic observational selection effects (e.g. Malmquist bias) into simulated supernova samples via stochastic magnitude-limited detection.ximinf.nn_train— Training utilities for the neural network classifiers used in the inference step, including loss/accuracy functions, training/validation loops with early stopping, and JAX device setup helpers.ximinf.nn_test— Diagnostics for validating inference quality, notably TARP (Tests of Accuracy with Random Points) coverage statistics computed across parameter groups.ximinf.nn_inference— Neural posterior/likelihood-ratio inference. Builds and runs BlackJAX NUTS samplers over grouped parameter blocks, combining trained neural network outputs with analytic log-priors.
Typical workflow
- Simulate — Draw parameter sets with
generate_sim.scan_paramsand generate mock SN Ia samples withgenerate_sim.simulate_one. - (Optional) Apply selection effects — Use
selection_effects.apply_malmquist_biasto emulate realistic detection thresholds. - Train — Train per-group neural classifiers on simulated data with
nn_train.train_loop. - Infer — Sample the posterior over cosmological parameters with
nn_inference.sample_posterior/nn_inference.inference_loop, using a NUTS kernel built on the trained networks. - Validate — Check calibration of the resulting posteriors with
nn_test.compute_ecp_tarp_groups.
License
This project is licensed under the GNU General Public License v3.0 (GPLv3). See LICENSE for details.
Author
Adam Trigui — a.trigui@ip2i.in2p3.fr IP2I Lyon
Metadata
Release files for ximinf 0.0.175
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ximinf-0.0.175.tar.gz | 45.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ximinf-0.0.175-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 89.0 kB
Release files / ximinf-0.0.175.tar.gz
| Download URL | ximinf-0.0.175.tar.gz |
|---|---|
| Size | 45.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c172d2c249f8c3e365c7d647ff4c6743b30f2e5991e53a33c41b2bfaf881a17d
|
|
BLAKE2b-256 checksum How to use checksums |
11b9a2d6b2809c454ba0a4bc4fa37c2fe74601a93bd110b8814667f202f49858
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Release files / ximinf-0.0.175-py3-none-any.whl
| Download URL | ximinf-0.0.175-py3-none-any.whl |
|---|---|
| Size | 43.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
68d79ddb5f4fe6d4ad57b51ca9bcbf1a518dcb41080db692d1e83d3150099e96
|
|
BLAKE2b-256 checksum How to use checksums |
7a063e2346d3242e2741694a8f3aaadc25eab2b1329d29f1fb482275decc1957
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|