Skip to main content

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.

PyPI Documentation License: GPL v3

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 via skysurvey.
  • 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

  1. Simulate — Draw parameter sets with generate_sim.scan_params and generate mock SN Ia samples with generate_sim.simulate_one.
  2. (Optional) Apply selection effects — Use selection_effects.apply_malmquist_bias to emulate realistic detection thresholds.
  3. Train — Train per-group neural classifiers on simulated data with nn_train.train_loop.
  4. 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.
  5. 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.180

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ximinf 0.0.180
File Size Uploaded
ximinf-0.0.180.tar.gz 45.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ximinf 0.0.180
File Interpreter ABI Platform
ximinf-0.0.180-py3-none-any.whl Python 3 none any Details

Total release size: 89.5 kB

Release files / ximinf-0.0.180.tar.gz

Download URL ximinf-0.0.180.tar.gz
Size 45.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f110f149d6e7f3c5ec2251c663cb780fb6102ab5788da0fe2daab6fa1c74a88e
BLAKE2b-256 checksum
How to use checksums
c0fc6eec2b38dc672ac0bc4bc563f2b9c2668f13d47f478c37269012e5ee7869
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / ximinf-0.0.180-py3-none-any.whl

Download URL ximinf-0.0.180-py3-none-any.whl
Size 43.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df09865729a4d9c3b915a14795b04d715f353ef5d69d17c1bb72e39444fab6cd
BLAKE2b-256 checksum
How to use checksums
e56ad4318ea40dfdbc035c6b8acc2cbfc2b3a3c4d9bcc2d006b63a7d02e3cd34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release history Release notifications | RSS feed

This release

0.0.180 This release

2 release files

0.0.99

2 release files

0.0.96

2 release files

0.0.95

2 release files

0.0.94

2 release files

0.0.93

2 release files

0.0.92

2 release files

0.0.91

2 release files

0.0.90

2 release files

0.0.89

2 release files

0.0.88

2 release files

0.0.87

2 release files

0.0.86

2 release files

0.0.85

2 release files

0.0.84

2 release files

0.0.83

2 release files

0.0.82

2 release files

0.0.81

2 release files

0.0.80

2 release files

0.0.79

2 release files

0.0.78

2 release files

0.0.77

2 release files

0.0.76

2 release files

0.0.75

2 release files

0.0.74

2 release files

0.0.73

2 release files

0.0.72

2 release files

0.0.71

2 release files

0.0.70

2 release files

0.0.42

2 release files

0.0.41

2 release files

0.0.40

2 release files

0.0.39

2 release files

0.0.38

2 release files

0.0.37

2 release files

0.0.36

2 release files

0.0.35

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.31

2 release files

0.0.30

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page