Skip to content

Releases: bayesflow-org/bayesflow

2.0.6 - Stateless Adapters, Augmentations, Bugfixes, and Better Diffusion Models

19 Jul 18:48
19b1699
Compare
Choose a tag to compare
  • Various score-based diffusion models are now directly available in the networks module.
  • ECDF Calibration plots support arbitrary test statistics for more expressive diagnostics
  • Adapters are now completely stateless, leading to less hassle for standardization
  • A new module augmentations will collect non-serializable transforms applied during training. NNPE for robust training (Ward et al., 2022) has been added, and many more are coming!
  • Small bugfixes with internal passing of arguments have been applied
  • Two new tutorial notebooks are available on likelihood learning and multimodal inference

2.0.5-patch - Log gamma statistic and standardization layer fix

02 Jul 09:11
c52221d
Compare
Choose a tag to compare

What's Changed

  • An important bugfix for standardization layers on multi-input networks and 3D > inputs.
  • Added log gamma statistic for better simulation-based checking as proposed by:
    Modrák, M., Moon, A. H., Kim, S., Bürkner, P., Huurre, N., Faltejsková, K., ... & Vehtari, A. (2025). Simulation-based calibration checking for Bayesian computation: The choice of test quantities shapes sensitivity. Bayesian Analysis, 20(2), 461-488.

2.0.4 -Diffusion models, bugfixes, new standardization utility, and more

18 Jun 07:44
Compare
Choose a tag to compare

🚀 BayesFlow v2.0.4 – Flexibility and Stability

We’re excited to announce BayesFlow v2.0.4 – a major release packed with stability upgrades, smarter networks, diffusion models, and tools for multimodal inference.


✨ Highlights

🔁 Diffusion Models for Inference

  • Integrated a flexible DiffusionModel implementation following Kingma et al. (2023)
  • Added SDE solvers and flexible sampling support. You can try out different diffusion model flavors!
  • Unified behavior across inference networks and removed deprecations of subnet_kwargs

🧠 Smarter Networks and Fusion

  • Introduced FusionNetwork for multimodal learning via late fusion
  • New Group / Ungroup transforms for flexible input structuring
  • Redesigned how summary/inference networks are discovered and dispatched

🧪 Simulation & Data Handling

  • Added subsample() and take() transforms with percent-based slicing
  • Included *NaN replacement transform for taking care of missing values
  • Enabled batch simulation utilities and new dataset augmentation strategies
  • Improved consistency for disk/offline datasets, including shuffle control
  • Enabled arbitrary data augmentations to datasets for transformations applied only during training

📏 Stability and Standardization

  • Created new Standardization layers that are now managed by approximators - no need for stateful adapters
  • Introduced moving mean/variance tracking with stable zero-variance handling
  • Replaced unstable PositiveDefinite link with robust CholeskyFactor estimation for MVN approximate distributions
  • Fixed validation loss aggregation

🧮 Model Comparison & Approximators

  • Better handling of heterogeneous simulator outputs in model comparison
  • Overhauled metrics tracking with train/val split and custom metric support
  • Streamlined all approximators with unified .prepare_data() logic and log_prob fixes
  • Serialization is now safer and more consistent across backends and training stages

🧪 Diagnostics, Docs, and Dev Tools

  • New tutorials: likelihood estimation, multimodal simulations, and a book on Cognitive Modeling with BayesFlow
  • Improved pair plots, better spacing, and legend layering
  • Added new notebooks and polished documentation for approximators, diagnostics, and data handling
  • BayesFlow now officially supports Python 3.12

🧰 Under-the-Hood Improvements

  • Custom Sequential module to resolve Keras build/serialization issues
  • More robust test suite with extended coverage for transforms, metrics, networks, and approximators
  • Smarter dispatching of networks and dynamic simulator configurations

🔧 Breaking & Deprecated

  • standardize adapter transforms should be used only with precomputed loc and scale. → rely on the new built-in standardization utility of approximators!
  • Deprecated approx.summaries → use approx.summarize instead
  • Moved toward FutureWarning for deprecated features
  • Use probs instead of logits for ModelComparisonApproximator

👥 Special Thanks to Contributors

Big kudos to @LarsKue, @valentinpratz, @han-ol, @arrjon, @elseml, @jerrymhuang, @daniel-habermann for pushing this release forward!


👉 Ready to try it?

Install or upgrade via:

pip install "bayesflow>=2.0.4"

v2.0.3 - fixes to serialization and new features

05 May 22:38
afc1af1
Compare
Choose a tag to compare

🚀 BayesFlow v2.0.3 Release Notes

⚠️ Important Notice: Breaking Changes

This release introduces significant changes to the serialization pipeline and is not backward-compatible with v2.0.2 or earlier. Models saved with older versions of BayesFlow will likely be incompatible with this release, but models trained in the future will be backward compatible with this release.

We strongly recommend updating your workflows and referring to the updated documentation to ensure a smooth transition.

📚 Documentation Updates

Enhanced the README.md with:

  • A detailed guide for migrating from BayesFlow v1.x to v2.
  • Clear warnings about breaking changes and missing features (e.g., hierarchical models, MCMC).
  • Pointers for users seeking parity with legacy functionality.
    See changes →

🔧 Backend Enhancements

  • Simplified version management: __version__ is now dynamically set using importlib.metadata.
  • Removed redundant exception handling for unsupported package imports.

🌀 Transform Enhancements

New Feature: Added support for log_det_jac (log-determinant Jacobian) in multiple transform classes:

  • Constrain
  • Concatenate
  • Drop

The Adapter class now optionally returns the log_det_jac alongside transformed data in both forward and inverse methods.
These improvements enhance support for probabilistic modeling workflows involving change-of-variable techniques.

🧬 Serialization Improvements

  • Applied the @serializable decorator with explicit namespace="bayesflow.adapters" to key transform classes: AsSet, Broadcast, Constrain, and others. This improves the consistency and reliability of object serialization across the library, especially for save/load operations in custom pipelines.

✅ Summary

This release improves usability, extensibility, and transform robustness, especially for users of advanced transformations. While it introduces breaking changes, it also lays a more stable foundation for future developments. Stay tuned!

v2.0.2 Fixes to usability, tests, and flow matching

26 Apr 12:54
822ad89
Compare
Choose a tag to compare
  • More tests, including notebooks
  • Fixed optimal transport for JAX
  • Improved dispatch for inference and summary networks (used in workflows)
  • Mixture distributions as latent spaces
  • Improved README
  • Fixed a warning about missing compile_from_config when loading approximators
  • Add NumFOCUS affiliation
  • Add issue templates
  • Removes the need to explicitly drop unused variables in custom Adapters

v2.0.1 - fixes and performance improvement

22 Apr 22:13
d31a761
Compare
Choose a tag to compare
  • Fixes bug with optimal transport for flow matching
  • Improved speed of import by 1200%
  • Improved tests for consistency models

🚀 BayesFlow v2.0 (Neo) Has Officially Arrived!

22 Apr 00:41
Compare
Choose a tag to compare

🎉 BayesFlow 2.0 is here! 🎉

We're thrilled to officially release BayesFlow 2.0 - a major leap forward in amortized Bayesian inference using modern neural networks. Whether you're a researcher, practitioner, or just getting started with Bayesian modeling, BayesFlow 2 is built to help you go from idea to inference faster than ever.

🔥 What's New in v2.0?

  • Multi-backend support with Keras 3: Choose your favorite ML framework - JAX, PyTorch, or TensorFlow - and switch seamlessly.

  • Cleaner, faster API: New workflows and interfaces make it easier than ever to build, train, and evaluate your models.

  • More neural network architectures: A rich set of ready-to-use building blocks tailored for simulation-based inference.

  • Smarter, more flexible design: Refined from the ground up to align with the latest advances in generative AI and Bayesian modeling.

🧠 What is BayesFlow?

BayesFlow lets you harness generative neural networks for fast and flexible Bayesian inference with any simulator. Whether you're estimating parameters, comparing models, or designing experiments, BayesFlow helps you turn simulations into statistical insight.

Check out the 3-step conceptual overview:

  • Choose your backend – thanks to Keras 3, you're free to use JAX, PyTorch, or TensorFlow.

  • Define your simulator – write your model in pure Python and generate data effortlessly.

  • Select your inference algorithm – train flexible neural networks to estimate what matters most.

🚀 Getting Started Is Easy

import bayesflow as bf

workflow = bf.BasicWorkflow(
    inference_network=bf.networks.CouplingFlow(),
    summary_network=bf.networks.TimeSeriesNetwork(),
    inference_variables=["parameters"],
    summary_variables=["observables"],
    simulator=bf.simulators.SIR()
)

history = workflow.fit_online(epochs=15, batch_size=32, num_batches_per_epoch=200)
diagnostics = workflow.plot_default_diagnostics(test_data=300)

🧪 Check out our growing library of tutorials and notebooks, from basic regression to Bayesian experimental design. Even better - contribute your own!

📦 Installation

You can install the latest version directly from PyPI or GitHub.

And don’t forget to install a supported backend - recommend JAX for top performance 🚀

BayesFlow 2.0 is fast, flexible, and freaking awesome. We can’t wait to see what you build with it.

Let us know what you think, and if you create something cool - open a PR or share it with the community! 💙

The BayesFlow Team

v1.1.6

19 Mar 10:44
543c45e
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.1.5...v1.1.6

v1.1.5

14 Mar 14:06
b38f23e
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.1.4...v1.1.5

JOSS

12 Sep 16:16
2bd8744
Compare
Choose a tag to compare

State of software at JOSS publication.