Skip to main content

Examples for the GenSBI library

Project description

GenSBI Examples

Build Coverage Version Downloads

This repository contains a collection of examples, tutorials, and recipes for GenSBI, a JAX-based library for Simulation-Based Inference using generative models.

These examples demonstrate how to use GenSBI for various tasks, including:

  • Defining and running inference pipelines.
  • Using different embedding networks (MLP, ResNet, etc.).
  • Handling various data types (1D signals, 2D images).

Installation

Prerequisites

You need to have GenSBI and the examples package installed.

With CUDA 12 support (Recommended):

pip install gensbi[cuda12, examples]

CPU-only:

pip install gensbi

Install Examples Package

To download these examples, clone the github repository:

git clone https://github.com/aurelio-amerio/GenSBI-examples.git

Structure

  • examples/: Contains standalone example scripts and notebooks.
  • src/gensbi_examples: Helper utilities for the examples.

Getting Started

  • My First Model: Open In Colab

Neural Density Estimators (NDE)

These examples demonstrate the usage of Neural Density Estimators for unconditional density estimation tasks.

  • Diffusion 2D Unconditional: Open In Colab
  • Flow Matching 2D Unconditional: Open In Colab
  • Flow Matching 2D Unconditional (Flux1Joint): Open In Colab

SBI Benchmark Examples

This repository includes a comprehensive suite of Simulation-Based Inference (SBI) benchmarks. These examples cover a range of standard tasks used to evaluate SBI methods, including simple distributions, physical systems, and complex toy problems. For each task, we provide implementations using various generative models available in GenSBI, such as Flow Matching and Diffusion models with different architectures (Flux, SimFormer).

Two Moons

  • Diffusion Flux: Open In Colab
  • Diffusion Flux1Joint: Open In Colab
  • Diffusion SimFormer: Open In Colab
  • Flow Flux: Open In Colab
  • Flow Flux1Joint: Open In Colab
  • Flow SimFormer: Open In Colab

Bernoulli GLM

  • Flow Flux: Open In Colab
  • Flow Flux1Joint: Open In Colab

Gaussian Linear

  • Flow Flux: Open In Colab
  • Flow Flux1Joint: Open In Colab

Gaussian Mixture

  • Flow Flux: Open In Colab
  • Flow Flux1Joint: Open In Colab

Gravitational Waves

  • GW Example: Open In Colab

Lensing

  • Lensing Example: Open In Colab

SLCP

  • Flow Flux: Open In Colab
  • Flow Flux1Joint: Open In Colab
  • Flow SimFormer: Open In Colab

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gensbi_examples-0.1.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gensbi_examples-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file gensbi_examples-0.1.0.tar.gz.

File metadata

  • Download URL: gensbi_examples-0.1.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gensbi_examples-0.1.0.tar.gz
Algorithm Hash digest
SHA256 68de4bdf524a67c946e0c46c7dd98ede44b77bfc7415ff02dd4cfa7a7e8e7bce
MD5 a62531d7f4a37ff21f6a1fee7b5144c8
BLAKE2b-256 e178b4c247f2b358627c16e7045753cc3b7d25cf41c0a14f06c80e210a26d094

See more details on using hashes here.

Provenance

The following attestation bundles were made for gensbi_examples-0.1.0.tar.gz:

Publisher: python-publish.yml on aurelio-amerio/GenSBI-examples

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gensbi_examples-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gensbi_examples-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53bce2fc23421c47a8820a22774f44cce66525a46896f558108069216b7dc7b7
MD5 ab151a5fdf51ab5e8efafbed3c92b80d
BLAKE2b-256 df5e8bb67aa080f7e981fe0158d9560b3fd9f83904b073bc982a02dbcc7ee9cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for gensbi_examples-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on aurelio-amerio/GenSBI-examples

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page