Skip to content

Releases: bayesflow-org/bayesflow

2.0.12: New Transformers and PyMC Wrapper

08 May 21:51
a8fffba

Choose a tag to compare

This release includes several improvements, new integrations, and maintenance updates.

Highlights

  • Modernized transformers and deep sets (Breaking)
    Updated transformer implementations aligning with modern best-practices for faster convergence and more expressive summary networks.

  • PyMC wrapper for Neural Likelihood and Neural Ratio Estimation
    Added the long awaited PyMC wrapper supporting Neural Likelihood Estimation and Neural Ratio Estimation out of the box. Plug into any PyMC workflow as easy as:

from bayesflow.wrappers.pymc import NeuralDistribution
# works the same way with ratio or a continuous approximator
pymc_dist = NeuralDistribution(approximator=my_approximator, param_names=["a", "b", "c"])

New tutorials:

  • Neural Likelihood Estimation + PyMC

  • Neural Ratio Estimation + PyMC + HSSM

  • GLASS sampler for flow matching
    Added support for the GLASS sampler in flow matching workflows.

  • Improved testing suite
    Expanded and improved tests to increase reliability and coverage.

  • Minor bug fixes and improvements
    Includes smaller fixes, cleanup, and general quality-of-life improvements.

2.0.11: Compositional diffusion for hierarchical models and more

30 Apr 16:31
9e9ee37

Choose a tag to compare

What's Changed

  • Fix unconditional sampling by @arrjon
  • Docs: Sensible treatment of versions by @han-ol
  • Improve docstrings in workflows and method order in BasicWorkflow by @han-ol
  • Improve documentation and version handling in workflows by @LarsKue
  • Sample method determinism by @han-ol
  • Allow Ordered/OrderedQuantiles links to handle axes shorter than 3 by @han-ol
  • Compositional sampling by @arrjon - efficiently simulate and fit hierarchical Bayesian models; a new tutorial is also available!
  • Fix optimizer, custom metrics, and display bugs by @stefanradev93
  • Enable sample passing to diagnostic methods in workflow by @stefanradev93
  • Improve computation of marginal Bayes (N)RMSE for more dynamic ranges by @stefanradev93
  • New user guide by @stefanradev93 - a completely revamped and streamlined user guide demonstrating all major aspects of the library
  • Sanitize Couplings, MLPs, and a few other backend improvements by @stefanradev93

Full Changelog: v2.0.10...v2.0.11

PS: Agentic AI is Here

Feel free to also check out and improve on our BayesFlow Agentic Skill at https://github.com/Learning-Bayesian-Statistics/baygent-skills/tree/main.

2.0.10: Mixture scores and minor fixes

19 Mar 14:20
f9a7f2f

Choose a tag to compare

✨ Release notes

This release adds mixture scores for parametric distributions which were missing from the 2.0.9 release, along some minor fixes and improvements for the test and publishing workflows, corrections to the docs, and more intelligent coverage targets. Happy amortizing!

🆕 Added

  • Mixture scores for parametric distributions

Full Changelog: v2.0.9...v2.0.10

2.0.9 - Amortize whatever you like, however you like

17 Mar 23:59
18c69da

Choose a tag to compare

Release notes ✨

The next BayesFlow comes with a greatly refactored codebase and various new functionality. Saved networks in versions > 2.0.8 may not deserialize properly, so new workflows should update and existing workflows relying on pretrained networks should pin to 2.0.8. Serialization will be backward compatible starting with the next release.

Added 🆕

  • Maximally flexible sampling and inference interfaces for arbitrary shapes and data types (e.g., images, graphs)
  • Maximally flexible diffusion models, flow matching, and consistency models
  • Guidance and target masking for all diffusion-like models
  • Maximally flexible interface for different masks (attention, classifier-free guidance, etc)
  • A new set of SOTA UNet backbones for image generation (parameters to images) and estimation (images to parameters) and a dedicated tutorial.
  • New tutorials, including a new video tutorial on diffusion models
  • Contrastive neural ratio estimation (NRE) for MCMC integration as an alternative to NLE
  • Hierarchical models through a graphical approximator and a graphical simulator interfaces (still mildly experimental)
  • Ensembles of networks for training multiple summary and/or inference networks of different types with little to no hassle and a dedicated tutorial
  • Mixture scores for more expressive parametric Bayes estimators

Changed 🔧

  • Reimplementation of model comparison as a special case of scoring rule estimation (arbitrary Bayes estimators)
  • Maintenance and lots of housekeeping 🧹
  • Increased test coverage for summary and inference networks
  • Small bug fixes

As always, happy amortizing and let us know about your success stories or any problems you encounter!

2.0.8 - The Dawn of Diffusion Models

28 Jan 16:02
6db8e49

Choose a tag to compare

Release notes ✨

The next BayesFlow release adds substantial new functionality, largely centered on diffusion models (score-based, flow-matching, consistency) for simulation-based inference (see https://arxiv.org/abs/2512.20685 for more details) and various improvements.

Added 🆕

  • Guidance support for diffusion models.
  • Optional batched sampling for large inference datasets, with progress tracking and wall-clock time reporting.
  • Additional progress bars for sampling workflows.
  • New options for flow matching, including conditional optimal transport.
  • A more robust C2ST test, plus new diagnostics.

Changed 🔧

  • Improved diffusion-model solvers.
  • Vastly improved default backbones for diffusion-like models (diffusion, flow matching, consistency). Expect significant performance boosts! (BREAKING for loading old models trained in previous versions)
  • Improved internal handling of inference phases, enabling arbitrary subnetworks that can process targets, conditions, and time in flexible ways.
  • Expanded sampling flexibility (e.g., time-varying parameters, images, and other structured targets/conditions) and sample_shape option.

Maintenance 🧹

  • Increased test coverage.
  • Multiple bug fixes.

As always, happy amortizing!

2.0.7 - More Powerful Diagnostics, Bugfixes, and Automatic Selection of Backends

27 Aug 07:48
12aaeb5

Choose a tag to compare

What's Changed

  • More expressive diagnostics for joint calibration. Better pair plots with arbitrary quantities.
  • Better default settings for DeepSets and Diffusion Models.
  • Automatic selection of backends. No more fiddling with os.environ unless needed!
  • Minor bugfixes
  • New tutorial on spatial data

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

19 Jul 18:48
19b1699

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

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

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

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!