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

Release files for ximinf 0.0.170

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.170
File Size Uploaded
ximinf-0.0.170.tar.gz 42.0 kB Details

Built distribution (wheel)

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

Total release size: 86.2 kB

Release files / ximinf-0.0.170.tar.gz

Download URL ximinf-0.0.170.tar.gz
Size 42.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5a4dfea2eea6d73bd5068124c93421e15ce37af6e1b4e03d632638156496ac02
BLAKE2b-256 checksum
How to use checksums
514129bf7a65bc4b0a2139729843f584924471c7351c294926e835d00dcf8c67
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.170-py3-none-any.whl

Download URL ximinf-0.0.170-py3-none-any.whl
Size 44.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a65506939585695bbd82001f8a8f75974dec34d724244092f3c787d0f3c0db2b
BLAKE2b-256 checksum
How to use checksums
fcf784c7f42b49f8ebb87228172c9fd24dc834ff9fb9da198a14c7f861fc3187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

This release

0.0.170 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