Skip to main content

CLI-driven framework for simulation-based inference with large simulators

Project description

Falcon

Tests codecov Documentation

Falcon (Factorized Adaptive Learning of Conditional Orchestrated Networks) is a CLI-driven Python framework for simulation-based inference (SBI) with large, expensive simulators. Born in astrophysics, built for any domain with complex forward models — break your model into components and Falcon jointly infers their parameters.

  • Composable — define multi-component models as a graph of simulators in YAML, each wrapped with a thin Python interface, regardless of framework.
  • Adaptive — steers simulations toward high-posterior regions as training progresses, focusing compute where it matters.
  • Concurrent — trains neural posterior estimators across heterogeneous parameter blocks in parallel, using Ray for distributed execution.
  • Batteries included — ships with neural spline flows, data embeddings (including CNN/transformer support), and built-in experiment tracking via WandB.

Installation

pip install falcon-sbi

For development:

git clone https://github.com/cweniger/falcon.git
cd falcon
pip install -e ".[monitor]"

Quick Start

Run the minimal example (a 3-parameter Gaussian inference problem):

cd examples/01_minimal
falcon launch -o outputs/run_01
falcon sample posterior -o outputs/run_01

This trains a neural posterior estimator on simulated data, then draws 1000 posterior samples. Results are saved under outputs/run_01/.

How It Works

You define a directed graph of random variables in config.yml. Each node has a simulator (forward model) and optionally an estimator (learned posterior). Falcon iterates between simulating data and training the estimator, automatically managing the sample buffer.

graph:
  z:                                    # Latent parameters
    evidence: [x]
    simulator:
      _target_: falcon.priors.Hypercube
      priors:
        - ['uniform', -5.0, 5.0]
    estimator:
      _target_: falcon.estimators.Flow

  x:                                    # Observations
    parents: [z]
    simulator:
      _target_: model.Simulate
    observed: "./data/obs.npz['x']"

CLI

falcon launch [-o DIR] [-c CONFIG] [key=value ...]
falcon sample prior|posterior|proposal -o DIR
falcon graph                            # Visualize graph structure
falcon monitor                          # Real-time TUI dashboard (requires pip install "falcon[monitor]")

Examples

Example Description
01_minimal Basic 3-parameter inference
02_bimodal 10D bimodal posterior with training strategies
03_composite Multi-node graph with image embeddings
04_gaussian Gaussian inference
05_linear_regression Linear regression

Documentation

For tutorials, configuration reference, and API docs, see cweniger.github.io/falcon.

Citation

@software{falcon2024,
  title = {Falcon: Distributed Dynamic Simulation-Based Inference},
  author = {Weniger, Christoph},
  year = {2024},
  url = {https://github.com/cweniger/falcon}
}

License

MIT License - see LICENSE for details.

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

falcon_sbi-0.4.1.tar.gz (9.8 MB view details)

Uploaded Source

Built Distribution

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

falcon_sbi-0.4.1-py3-none-any.whl (97.4 kB view details)

Uploaded Python 3

File details

Details for the file falcon_sbi-0.4.1.tar.gz.

File metadata

  • Download URL: falcon_sbi-0.4.1.tar.gz
  • Upload date:
  • Size: 9.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for falcon_sbi-0.4.1.tar.gz
Algorithm Hash digest
SHA256 a9a0a0b445283f7ed2f278cee0a11869a2be46bc40f12c69795e57907ef25dc2
MD5 c21fbc03218b82408e679b2fc11b6d17
BLAKE2b-256 99bc4b0834e5c6a0f3846a9325c856c42c65688f6b029b3d07d2e59788780544

See more details on using hashes here.

Provenance

The following attestation bundles were made for falcon_sbi-0.4.1.tar.gz:

Publisher: publish.yml on cweniger/falcon

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

File details

Details for the file falcon_sbi-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: falcon_sbi-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 97.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for falcon_sbi-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c730ec5611f26fd3ba7e1a9d917c0c088dca1f27f61ca1129aac7cbbaa2cb4f
MD5 f4a90447b51fb8586ddb19c0a50590c3
BLAKE2b-256 d426c18bbfc040332ae319b715e65499fabaaf10a662c0be06ad65364c39990d

See more details on using hashes here.

Provenance

The following attestation bundles were made for falcon_sbi-0.4.1-py3-none-any.whl:

Publisher: publish.yml on cweniger/falcon

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