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.
翻译:现代贝叶斯推断涉及多种计算方法的混合,用于在原则性工作流中估计、验证和从概率模型中得出结论。许多贝叶斯方法的一个共同特点是相对缓慢,当将复杂模型拟合到大数据集时,这往往成为限制因素。摊销贝叶斯推断(ABI)提供了一条解决贝叶斯计算难题的途径。ABI在模型模拟上训练神经网络,使用户能够快速推断任何模型隐含的量,如点估计、似然或完整后验分布。本研究介绍了用于通用ABI的Python库BayesFlow 2.0版本。该软件除了直接支持后验、似然和比率估计外,还兼容多个流行的深度学习后端,包含丰富的生成网络用于采样和密度估计,提供完全定制化和高级接口,并新增了超参数优化、设计优化和分层建模功能。通过一个动态系统参数估计的案例研究,并与类似软件进行比较,我们证明这种精简且用户友好的工作流具有支持广泛应用的强大潜力。