Modern Bayesian inference involves a mixture of computational methods for estimating, validating, and drawing conclusions from probabilistic models as part of principled workflows. An overarching motif of many Bayesian methods is that they are relatively slow, which often becomes prohibitive when fitting complex models to large data sets. Amortized Bayesian inference (ABI) offers a path to solving the computational challenges of Bayes. ABI trains neural networks on model simulations, rewarding users with rapid inference of any model-implied quantity, such as point estimates, likelihoods, or full posterior distributions. In this work, we present the Python library BayesFlow, Version 2.0, for general-purpose ABI. Along with direct posterior, likelihood, and ratio estimation, the software includes support for multiple popular deep learning backends, a rich collection of generative networks for sampling and density estimation, complete customization and high-level interfaces, as well as new capabilities for hyperparameter optimization, design optimization, and hierarchical modeling. Using a case study on dynamical system parameter estimation, combined with comparisons to similar software, we show that our streamlined, user-friendly workflow has strong potential to support broad adoption.
翻译:现代贝叶斯推断包含一系列计算方法,用于估计、验证概率模型并从中得出结论,这些方法是原则性工作流程的一部分。许多贝叶斯方法的一个普遍特点是计算速度相对较慢,这在将复杂模型拟合到大型数据集时往往成为瓶颈。摊销贝叶斯推断为解决贝叶斯计算难题提供了一条途径。该方法通过在模型模拟数据上训练神经网络,使用户能够快速推断任何模型隐含的量,例如点估计、似然函数或完整的后验分布。本研究介绍了用于通用摊销贝叶斯推断的Python库BayesFlow 2.0。该软件除支持直接后验估计、似然估计和比率估计外,还具备以下特性:支持多种主流深度学习后端;提供丰富的生成网络用于采样和密度估计;支持完全定制化与高层接口;新增超参数优化、设计优化和分层建模功能。通过动态系统参数估计的案例研究,并结合与同类软件的对比,我们证明该库的简洁化、用户友好型工作流程具有推动广泛应用的强大潜力。