[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-bayesflow-org--bayesflow":3,"tool-bayesflow-org--bayesflow":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",159636,2,"2026-04-17T23:33:34",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":64,"owner_avatar_url":73,"owner_bio":74,"owner_company":75,"owner_location":75,"owner_email":75,"owner_twitter":75,"owner_website":75,"owner_url":76,"languages":77,"stars":104,"forks":105,"last_commit_at":106,"license":107,"difficulty_score":32,"env_os":108,"env_gpu":109,"env_ram":108,"env_deps":110,"category_tags":119,"github_topics":121,"view_count":32,"oss_zip_url":75,"oss_zip_packed_at":75,"status":17,"created_at":130,"updated_at":131,"faqs":132,"releases":161},8737,"bayesflow-org\u002Fbayesflow","bayesflow","A Python library for efficient Bayesian modeling with deep learning","BayesFlow 是一个专为高效贝叶斯建模打造的 Python 开源库，它巧妙地将深度学习技术与传统统计推断相结合。面对复杂模拟器无法用公式表达、或传统方法计算效率低下的难题，BayesFlow 提供了一套流畅的“摊销贝叶斯”工作流：用户只需定义模拟过程生成数据，即可利用神经网络快速完成参数估计、模型比较与验证，大幅降低了高维概率推断的门槛。\n\n这款工具特别适合科研人员、数据科学家以及需要处理复杂随机模拟系统的开发者使用。无论是研究物理、生物等领域的复杂系统，还是探索新型统计模型，BayesFlow 都能成为得力的助手。其核心亮点在于强大的兼容性与灵活性：基于 Keras 3 架构，它同时支持 PyTorch、TensorFlow 和 JAX 三大主流后端，用户可根据硬件环境自由选择，其中 JAX 因速度优势被官方推荐。此外，库内集成了从扩散模型到一致性模型等多种前沿生成式 AI 技术，并配备了鲁棒的诊断功能，确保推断结果的可靠性。通过简洁易用的 API，BayesFlow 让复杂的仿真智能变得触手可及，是连接模拟实验与深度学习的黄金标准工具包。","# BayesFlow\n\n![GitHub Actions Workflow Status](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fbayesflow-org\u002Fbayesflow\u002Ftests.yaml?style=for-the-badge&label=Tests)\n![Codecov](https:\u002F\u002Fimg.shields.io\u002Fcodecov\u002Fc\u002Fgithub\u002Fbayesflow-org\u002Fbayesflow?style=for-the-badge&link=https%3A%2F%2Fapp.codecov.io%2Fgh%2Fbayesflow-org%2Fbayesflow%2Ftree%2Fmain)\n[![DOI](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDOI-10.21105%2Fjoss.05702-blue?style=for-the-badge)](https:\u002F\u002Fdoi.org\u002F10.21105\u002Fjoss.05702)\n![PyPI - License](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fl\u002Fbayesflow?style=for-the-badge)\n![NumFOCUS Affiliated Project](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNumFOCUS-Affiliated%20Project-orange?style=for-the-badge)\n\nBayesFlow is a Python library for efficient Bayesian inference with deep learning.\nIt provides users with:\n\n- A user-friendly API for [amortized Bayesian workflows](https:\u002F\u002Farxiv.org\u002Fabs\u002F2602.07098)\n- A rich collection of generative models, [from diffusion to consistency models](https:\u002F\u002Fbayesflow-org.github.io\u002Fdiffusion-experiments\u002F)\n- Multi-backend support via [Keras3](https:\u002F\u002Fkeras.io\u002Fkeras_3\u002F): You can use [PyTorch](https:\u002F\u002Fgithub.com\u002Fpytorch\u002Fpytorch), [TensorFlow](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Ftensorflow), or [JAX](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fjax)\n\n## Conceptual Overview\n\n\u003Cdiv align=\"center\">\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\".\u002Fimg\u002Fbf_landing_dark.png\">\n  \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbayesflow-org_bayesflow_readme_a3e8c19b3bb7.png\">\n  \u003Cimg alt=\"Overview graphic on using BayesFlow. It is split in three columns: 1. Simulate: generate data from any simulation you like. 2. Amortize: use BayesFlow to define your neural estimator with any deep learning backend you choose, as it is part of the Keras ecosystem. 3. Learn: with powerful generative AI and robust diagnostic features, BayesFlow is the gold-standard toolkit for simulation intelligence.\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbayesflow-org_bayesflow_readme_a3e8c19b3bb7.png\">\n\u003C\u002Fpicture>\n\u003C\u002Fdiv>\n\nWith BayesFlow, you can easily train neural networks for tasks like parameter estimation, model comparison, and validation. It works for both complex simulators that cannot be expressed as parametric models (i.e., simulation-based inference) as well as traditional statistical models. BayesFlow provides a streamlined workflow layer for inference, especially in situations where conventional methods are unavailable or inefficient.\n\n## Install\n\nWe currently support Python 3.11 to 3.13. You can install the latest stable version from PyPI using:\n\n```bash\npip install \"bayesflow>=2.0\"\n```\n\nIf you want the latest features, you can install from source:\n\n```bash\npip install git+https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow.git@dev\n```\n\nIf you encounter problems with this or require more control, please refer to the instructions to install from source below.\n\n### Backend\n\nTo use BayesFlow, you will also need to install one of the following machine learning backends.\nNote that BayesFlow **will not run** without a backend.\n\n- [Install JAX](https:\u002F\u002Fjax.readthedocs.io\u002Fen\u002Flatest\u002Finstallation.html)\n- [Install PyTorch](https:\u002F\u002Fpytorch.org\u002Fget-started\u002Flocally\u002F)\n- [Install TensorFlow](https:\u002F\u002Fwww.tensorflow.org\u002Finstall)\n\nIf you don't know which backend to use, we recommend JAX as it is currently the fastest backend.\n\nAs of version ``2.0.7``, the backend will be set automatically. If you have multiple backends, you can manually [set the backend environment variable as described by keras](https:\u002F\u002Fkeras.io\u002Fgetting_started\u002F#configuring-your-backend).\nFor example, inside your Python script write:\n\n```python\nimport os\nos.environ[\"KERAS_BACKEND\"] = \"jax\"\nimport bayesflow\n```\n\nIf you use conda, you can alternatively set this individually for each environment in your terminal. For example:\n\n```bash\nconda env config vars set KERAS_BACKEND=jax\n```\n\nOr just plainly set the environment variable in your shell:\n\n```bash\nexport KERAS_BACKEND=jax\n```\n\n## Getting Started\n\nUsing the high-level interface is easy, as demonstrated by the minimal working example below:\n\n```python\nimport bayesflow as bf\n\nworkflow = bf.BasicWorkflow(\n    inference_network=bf.networks.FlowMatching(),\n    inference_variables=[\"parameters\"],\n    inference_conditions=[\"observables\"],\n    simulator=bf.simulators.SIR()\n)\n\nhistory = workflow.fit_online(epochs=20, batch_size=32, num_batches_per_epoch=200)\n\ndiagnostics = workflow.plot_default_diagnostics(test_data=300)\n```\n\nFor an in-depth exposition, check out our expanding list of resources below.\n\n### Books\n\nMany examples from *Bayesian Cognitive Modeling: A Practical Course* by Lee & Wagenmakers (2013) in [BayesFlow](https:\u002F\u002Fkucharssim.github.io\u002Fbayesflow-cognitive-modeling-book\u002F).\n\n### Videos\n\nA few video tutorial videos are available as part of the [Learning Bayesian Statistics](https:\u002F\u002Flearnbayesstats.com\u002F) podcast:\n\n1. Marvin Schmitt on [Amortized Bayesian Inference with Neural Networks](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=_lotzkvy6mY)\n2. Jonas Arruda on [Diffusion Models for Simulation-Based Inference](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=ZlcEkHXgF5k)\n\n### Tutorial notebooks\n\n1. [Diffusion starter](examples\u002FDiffusion_Models.ipynb) - A small tutorial on the power of diffusion models for SBI.\n2. [Linear regression](examples\u002FLinear_Regression_Starter.ipynb) - Fit your first Bayesian regression with varying sample size.\n3. [Image data](examples\u002FSpatial_Data_and_Parameters.ipynb) - Learn parameters from or generate image data.\n4. [Bayes estimators](examples\u002FLotka_Volterra_Point_Estimation.ipynb) - From simple point estimates to fully Bayesian inference.\n5. [Model comparison](examples\u002FOne_Sample_TTest.ipynb) - Learn Bayes factors using probabilistic classification.\n6. [From ABC to BayesFlow](examples\u002FFrom_ABC_to_BayesFlow.ipynb) - Upgrade from sequential to amortized inference.\n7. [SIR](examples\u002FSIR_Posterior_Estimation.ipynb) - Model infectuous diseases through an end-to-end Bayesian workflow.\n8. [Bayesian experimental design](examples\u002FBayesian_Experimental_Design.ipynb) - Perform adaptive sequential experiments.\n9. [Estimating likelihoods](examples\u002FLikelihood_Estimation.ipynb) - Learn synthetic likelihood functions.\n10. [Multimodal data](examples\u002FMultimodal_Data.ipynb) - Fuse different data types for more informative inference.\n11. [Ensembles](examples\u002FEnsembles.ipynb) - Train different networks at the same time and combine inferences.\n12. [Ratio estimation](examples\u002FRatio_Estimation.ipynb) - Learn neural ratios for downstream MCMC sampling.\n\n### Tutorial papers\n\n1. Arruda, J., Bracher, N., Köthe, U., Hasenauer, J., & Radev, S. T. (2025). Diffusion Models in Simulation-Based Inference: A Tutorial Review. *arXiv preprint arXiv:2512.20685*. [Project page](https:\u002F\u002Fbayesflow-org.github.io\u002Fdiffusion-experiments\u002F). [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2512.20685)\n\nMore tutorials are always welcome! Please consider making a pull request if you have a cool application that you want to contribute.\n\n## Contributing\n\nIf you want to contribute to BayesFlow, we recommend installing it from source, see [CONTRIBUTING.md](CONTRIBUTING.md) for more details.\n\n## Reporting Issues\n\nIf you encounter any issues, please don't hesitate to open an issue here on [Github](https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow\u002Fissues) or ask questions on our [Discourse Forums](https:\u002F\u002Fdiscuss.bayesflow.org\u002F).\n\n## Documentation \\& Help\n\nDocumentation is available at https:\u002F\u002Fbayesflow.org. Please use the [BayesFlow Forums](https:\u002F\u002Fdiscuss.bayesflow.org\u002F) for any BayesFlow-related questions and discussions, and [GitHub Issues](https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow\u002Fissues) for bug reports and feature requests.\n\n## Citing BayesFlow\n\nIf you are using the new multi-backend version of BayesFlow, we recommend citing our new [software paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2602.07098) (Kühmichel et al., 2026). For uses of the [legacy version](https:\u002F\u002Fjoss.theoj.org\u002Fpapers\u002F10.21105\u002Fjoss.05702), you can still reference Radev et al., (2023).\n\n**BibTeX:**\n\n```\n@article{kuhmichel2026bayesflow,\n  title={{BayesFlow} 2: Multi-backend amortized {B}ayesian inference in Python},\n  author={Kühmichel, Lars and Huang, Jerry M and Pratz, Valentin and Arruda, Jonas and Olischläger, Hans and Habermann, Daniel and Kucharsky, Simon and Elsemüller, Lasse and Mishra, Aayush and Bracher, Niels and Jedhoff, Svenja and Schmitt, Marvin and Bürkner, Paul-Christian and Radev, Stefan T},\n  journal={arXiv preprint arXiv:2602.07098},\n  year={2026}\n}\n\n@article{bayesflow_2023_software,\n  title = {{BayesFlow}: Amortized {B}ayesian workflows with neural networks},\n  author = {Radev, Stefan T and Schmitt, Marvin and Schumacher, Lukas and Elsemüller, Lasse and Pratz, Valentin and Schälte, Yannik and Köthe, Ullrich and Bürkner, Paul-Christian},\n  journal = {Journal of Open Source Software},\n  volume = {8},\n  number = {89},\n  pages = {5702},\n  year = {2023}\n}\n```\n\n## FAQ\n\n-------------\n\n**Question:**\nI am starting with Bayesflow, which backend should I use?\n\n**Answer:**\nWe recommend JAX as it is currently the fastest backend.\n\n-------------\n\n**Question:**\nI am getting `ModuleNotFoundError: No module named 'tensorflow'` when I try to import BayesFlow.\n\n**Answer:**\nOne of these applies:\n\n- You want to use tensorflow as your backend, but you have not installed it.\nSee [here](https:\u002F\u002Fwww.tensorflow.org\u002Finstall).\n\n- You want to use a backend other than tensorflow, but have not set the environment variable correctly.\nSee [here](https:\u002F\u002Fkeras.io\u002Fgetting_started\u002F#configuring-your-backend).\n\n- You have set the environment variable, but it is not being picked up by Python.\nThis can happen silently in some development environments (e.g., VSCode or PyCharm).\nTry setting the backend as shown [here](https:\u002F\u002Fkeras.io\u002Fgetting_started\u002F#configuring-your-backend)\nin your Python script via `os.environ`.\n\n-------------\n\n**Question:**\nWhat is the difference between Bayesflow 2 and previous versions?\n\n**Answer:**\nBayesFlow 2.0+ is a complete rewrite of the library. It shares the same overall goals with previous versions, but has much better modularity and extensibility. What is more, the new BayesFlow has multi-backend support via Keras3, while the old version was based on TensorFlow.\n\n-------------\n\n## Awesome Amortized Inference\n\nIf you are interested in a curated list of resources, including reviews, software, papers, and other resources related to amortized inference, feel free to explore our [community-driven list](https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fawesome-amortized-inference). If you'd like a paper (by yourself or someone else) featured, please add it to the list with a pull request, an issue, or a message to the maintainers.\n\n## Acknowledgments\n\nThis project is currently managed by researchers from Rensselaer Polytechnic Institute, TU Dortmund University, and Heidelberg University. It is partially funded by the National Science Foundation (NSF) Award Number 2448380 and the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) Projects 528702768 and 508399956 as well as DFG Collaborative Research Center 391.\n\nBayesFlow is a [NumFOCUS Affiliated Project](https:\u002F\u002Fnumfocus.org\u002Fsponsored-projects\u002Faffiliated-projects).\n","# BayesFlow\n\n![GitHub Actions 工作流状态](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fbayesflow-org\u002Fbayesflow\u002Ftests.yaml?style=for-the-badge&label=Tests)\n![Codecov](https:\u002F\u002Fimg.shields.io\u002Fcodecov\u002Fc\u002Fgithub\u002Fbayesflow-org\u002Fbayesflow?style=for-the-badge&link=https%3A%2F%2Fapp.codecov.io%2Fgh%2Fbayesflow-org%2Fbayesflow%2Ftree%2Fmain)\n[![DOI](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDOI-10.21105%2Fjoss.05702-blue?style=for-the-badge)](https:\u002F\u002Fdoi.org\u002F10.21105\u002Fjoss.05702)\n![PyPI - 许可证](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fl\u002Fbayesflow?style=for-the-badge)\n![NumFOCUS 关联项目](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNumFOCUS-Affiliated%20Project-orange?style=for-the-badge)\n\nBayesFlow 是一个用于高效贝叶斯推断的深度学习 Python 库。\n它为用户提供：\n\n- 一个面向 [摊销贝叶斯工作流](https:\u002F\u002Farxiv.org\u002Fabs\u002F2602.07098) 的易用 API\n- 丰富的生成模型集合，[从扩散模型到一致性模型](https:\u002F\u002Fbayesflow-org.github.io\u002Fdiffusion-experiments\u002F)\n- 通过 [Keras3](https:\u002F\u002Fkeras.io\u002Fkeras_3\u002F) 提供多后端支持：您可以使用 [PyTorch](https:\u002F\u002Fgithub.com\u002Fpytorch\u002Fpytorch)、[TensorFlow](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Ftensorflow) 或 [JAX](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fjax)\n\n## 概念概述\n\n\u003Cdiv align=\"center\">\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\".\u002Fimg\u002Fbf_landing_dark.png\">\n  \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbayesflow-org_bayesflow_readme_a3e8c19b3bb7.png\">\n  \u003Cimg alt=\"关于如何使用 BayesFlow 的概览图。图表分为三列：1. 模拟：从您喜欢的任何模拟中生成数据。2. 摊销：使用 BayesFlow 定义您的神经估计器，选择任意深度学习后端，因为它属于 Keras 生态系统。3. 学习：凭借强大的生成式 AI 和稳健的诊断功能，BayesFlow 是模拟智能领域的黄金标准工具包。\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbayesflow-org_bayesflow_readme_a3e8c19b3bb7.png\">\n\u003C\u002Fpicture>\n\u003C\u002Fdiv>\n\n借助 BayesFlow，您可以轻松训练神经网络来完成参数估计、模型比较和验证等任务。它既适用于无法表示为参数化模型的复杂模拟器（即基于模拟的推断），也适用于传统统计模型。BayesFlow 为推断提供了一个简化的流程层，尤其在常规方法不可用或效率低下的情况下。\n\n## 安装\n\n我们目前支持 Python 3.11 至 3.13。您可以使用以下命令从 PyPI 安装最新稳定版本：\n\n```bash\npip install \"bayesflow>=2.0\"\n```\n\n如果您想要最新的功能，可以从源代码安装：\n\n```bash\npip install git+https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow.git@dev\n```\n\n如果您在此过程中遇到问题或需要更多控制，请参阅下方的源码安装说明。\n\n### 后端\n\n要使用 BayesFlow，您还需要安装以下机器学习后端之一。\n请注意，没有后端，BayesFlow **将无法运行**。\n\n- [安装 JAX](https:\u002F\u002Fjax.readthedocs.io\u002Fen\u002Flatest\u002Finstallation.html)\n- [安装 PyTorch](https:\u002F\u002Fpytorch.org\u002Fget-started\u002Flocally\u002F)\n- [安装 TensorFlow](https:\u002F\u002Fwww.tensorflow.org\u002Finstall)\n\n如果您不确定使用哪个后端，我们建议使用 JAX，因为它目前是最快的后端。\n\n自版本 ``2.0.7`` 起，后端将自动设置。如果您安装了多个后端，可以按照 keras 的说明手动设置后端环境变量。例如，在您的 Python 脚本中写入：\n\n```python\nimport os\nos.environ[\"KERAS_BACKEND\"] = \"jax\"\nimport bayesflow\n```\n\n如果您使用 conda，也可以在终端中为每个环境单独设置该变量。例如：\n\n```bash\nconda env config vars set KERAS_BACKEND=jax\n```\n\n或者直接在 shell 中设置环境变量：\n\n```bash\nexport KERAS_BACKEND=jax\n```\n\n## 入门\n\n使用高级接口非常简单，如下方的最小示例所示：\n\n```python\nimport bayesflow as bf\n\nworkflow = bf.BasicWorkflow(\n    inference_network=bf.networks.FlowMatching(),\n    inference_variables=[\"parameters\"],\n    inference_conditions=[\"observables\"],\n    simulator=bf.simulators.SIR()\n)\n\nhistory = workflow.fit_online(epochs=20, batch_size=32, num_batches_per_epoch=200)\n\ndiagnostics = workflow.plot_default_diagnostics(test_data=300)\n```\n\n如需深入了解，请查看我们不断扩充的资源列表。\n\n### 书籍\n\n许多来自 Lee & Wagenmakers (2013) 的《贝叶斯认知建模：实用教程》中的示例，现已收录于 [BayesFlow](https:\u002F\u002Fkucharssim.github.io\u002Fbayesflow-cognitive-modeling-book\u002F)。\n\n### 视频\n\n作为 [学习贝叶斯统计](https:\u002F\u002Flearnbayesstats.com\u002F) 播客的一部分，我们提供了一些视频教程：\n\n1. Marvin Schmitt 主讲的 [使用神经网络进行摊销贝叶斯推断](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=_lotzkvy6mY)\n2. Jonas Arruda 主讲的 [用于基于模拟推断的扩散模型](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=ZlcEkHXgF5k)\n\n### 教程笔记本\n\n1. [扩散模型入门](examples\u002FDiffusion_Models.ipynb) —— 介绍扩散模型在 SBI 中的强大功能。\n2. [线性回归入门](examples\u002FLinear_Regression_Starter.ipynb) —— 使用不同样本量拟合您的第一个贝叶斯回归。\n3. [图像数据](examples\u002FSpatial_Data_and_Parameters.ipynb) —— 从图像数据中学习参数或生成图像数据。\n4. [贝叶斯估计器](examples\u002FLotka_Volterra_Point_Estimation.ipynb) —— 从简单的点估计到完全贝叶斯推断。\n5. [模型比较](examples\u002FOne_Sample_TTest.ipynb) —— 使用概率分类法学习贝叶斯因子。\n6. [从 ABC 到 BayesFlow](examples\u002FFrom_ABC_to_BayesFlow.ipynb) —— 将顺序推断升级为摊销推断。\n7. [SIR 模型](examples\u002FSIR_Posterior_Estimation.ipynb) —— 通过端到端贝叶斯工作流对传染病进行建模。\n8. [贝叶斯实验设计](examples\u002FBayesian_Experimental_Design.ipynb) —— 执行自适应序列实验。\n9. [似然估计](examples\u002FLikelihood_Estimation.ipynb) —— 学习合成似然函数。\n10. [多模态数据](examples\u002FMultimodal_Data.ipynb) —— 融合不同类型的数据以获得更丰富的推断结果。\n11. [集成模型](examples\u002FEnsembles.ipynb) —— 同时训练多个网络并结合推断结果。\n12. [比率估计](examples\u002FRatio_Estimation.ipynb) —— 学习用于下游 MCMC 采样的神经比率。\n\n### 教程论文\n\n1. Arruda, J., Bracher, N., Köthe, U., Hasenauer, J., & Radev, S. T. (2025). 基于模拟推断中的扩散模型：教程综述。*arXiv 预印本 arXiv:2512.20685*。[项目页面](https:\u002F\u002Fbayesflow-org.github.io\u002Fdiffusion-experiments\u002F)。[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2512.20685)\n\n我们始终欢迎更多教程！如果您有一个很棒的应用程序想要分享，请考虑提交拉取请求。\n\n## 贡献\n\n如果您想为 BayesFlow 做贡献，我们建议您从源代码安装。更多详情请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。\n\n## 报告问题\n\n如果您遇到任何问题，请随时在 [Github](https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow\u002Fissues) 上提交问题，或在我们的 [Discourse 论坛](https:\u002F\u002Fdiscuss.bayesflow.org\u002F) 上提问。\n\n## 文档与帮助\n\n文档可在 https:\u002F\u002Fbayesflow.org 上找到。有关 BayesFlow 的任何问题和讨论，请使用 [BayesFlow 论坛](https:\u002F\u002Fdiscuss.bayesflow.org\u002F)；对于错误报告和功能请求，请使用 [GitHub 问题](https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow\u002Fissues)。\n\n## 引用 BayesFlow\n\n如果您正在使用 BayesFlow 的新多后端版本，我们建议引用我们的新 [软件论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2602.07098)（Kühmichel 等，2026 年）。对于使用 [旧版](https:\u002F\u002Fjoss.theoj.org\u002Fpapers\u002F10.21105\u002Fjoss.05702) 的情况，仍可参考 Radev 等人（2023 年）的文献。\n\n**BibTeX:**\n\n```\n@article{kuhmichel2026bayesflow,\n  title={{BayesFlow} 2: Multi-backend amortized {B}ayesian inference in Python},\n  author={Kühmichel, Lars and Huang, Jerry M and Pratz, Valentin and Arruda, Jonas and Olischläger, Hans and Habermann, Daniel and Kucharsky, Simon and Elsemüller, Lasse and Mishra, Aayush and Bracher, Niels and Jedhoff, Svenja and Schmitt, Marvin and Bürkner, Paul-Christian and Radev, Stefan T},\n  journal={arXiv preprint arXiv:2602.07098},\n  year={2026}\n}\n\n@article{bayesflow_2023_software,\n  title = {{BayesFlow}: Amortized {B}ayesian workflows with neural networks},\n  author = {Radev, Stefan T and Schmitt, Marvin and Schumacher, Lukas and Elsemüller, Lasse and Pratz, Valentin and Schälte, Yannik and Köthe, Ullrich and Bürkner, Paul-Christian},\n  journal = {Journal of Open Source Software},\n  volume = {8},\n  number = {89},\n  pages = {5702},\n  year = {2023}\n}\n```\n\n## 常见问题解答\n\n-------------\n\n**问：**\n我刚开始使用 Bayesflow，应该选择哪个后端？\n\n**答：**\n我们推荐 JAX，因为它目前是最快的后端。\n\n-------------\n\n**问：**\n当我尝试导入 BayesFlow 时，收到 `ModuleNotFoundError: No module named 'tensorflow'` 错误。\n\n**答：**\n可能有以下几种情况：\n\n- 您希望使用 TensorFlow 作为后端，但尚未安装它。\n请参阅 [此处](https:\u002F\u002Fwww.tensorflow.org\u002Finstall)。\n\n- 您希望使用其他后端，但未正确设置环境变量。\n请参阅 [此处](https:\u002F\u002Fkeras.io\u002Fgetting_started\u002F#configuring-your-backend)。\n\n- 您已设置环境变量，但 Python 未能识别它。\n这种情况在某些开发环境中（如 VSCode 或 PyCharm）可能会悄然发生。\n请尝试在您的 Python 脚本中通过 `os.environ` 按照 [此处](https:\u002F\u002Fkeras.io\u002Fgetting_started\u002F#configuring-your-backend) 所示的方式设置后端。\n\n-------------\n\n**问：**\nBayesflow 2 与之前版本有何不同？\n\n**答：**\nBayesFlow 2.0 及以上版本是对该库的全新重写。它与先前版本具有相同的目标，但在模块化和扩展性方面有了显著提升。此外，新版 BayesFlow 通过 Keras3 支持多后端，而旧版则基于 TensorFlow。\n\n-------------\n\n## 令人惊叹的摊销推断\n\n如果您对精选的资源列表感兴趣，其中包括关于摊销推断的综述、软件、论文及其他相关资料，欢迎浏览我们的 [社区驱动列表](https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fawesome-amortized-inference)。如果您希望将自己或其他人的论文收录其中，请通过拉取请求、提交问题或直接联系维护者将其添加到列表中。\n\n## 致谢\n\n该项目目前由伦斯勒理工学院、多特蒙德工业大学和海德堡大学的研究人员共同管理。项目部分资金来自美国国家科学基金会（NSF）资助编号 2448380，以及德国研究联合会（DFG）资助项目 528702768 和 508399956，同时还得到了 DFG 合作研究中心 391 的支持。\n\nBayesFlow 是一个 [NumFOCUS 关联项目](https:\u002F\u002Fnumfocus.org\u002Fsponsored-projects\u002Faffiliated-projects)。","# BayesFlow 快速上手指南\n\nBayesFlow 是一个用于高效贝叶斯推断的 Python 库，结合深度学习技术，支持基于模拟的推断（SBI）、参数估计和模型比较。它基于 Keras 3 构建，支持 PyTorch、TensorFlow 和 JAX 多种后端。\n\n## 环境准备\n\n- **Python 版本**：3.11 - 3.13\n- **必需依赖**：需安装至少一种深度学习后端（JAX、PyTorch 或 TensorFlow）。\n  - 推荐首选 **JAX**，目前性能最优。\n- **操作系统**：Linux、macOS 或 Windows（需确保后端兼容）\n\n> **注意**：未安装后端或未正确配置环境变量时，BayesFlow 将无法运行。\n\n## 安装步骤\n\n### 1. 安装深度学习后端（任选其一）\n\n**推荐安装 JAX：**\n```bash\npip install \"jax[cpu]\"  # CPU 版本\n# 或\npip install \"jax[cuda]\"  # GPU 版本（需 CUDA 环境）\n```\n\n**或安装 PyTorch：**\n```bash\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\n```\n\n**或安装 TensorFlow：**\n```bash\npip install tensorflow\n```\n\n### 2. 安装 BayesFlow\n\n**稳定版（推荐）：**\n```bash\npip install \"bayesflow>=2.0\"\n```\n\n**开发版（获取最新功能）：**\n```bash\npip install git+https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow.git@dev\n```\n\n### 3. 配置后端（可选）\n\n若系统安装了多个后端，需在代码中或环境变量中指定默认后端。\n\n**方式一：在 Python 脚本开头设置**\n```python\nimport os\nos.environ[\"KERAS_BACKEND\"] = \"jax\"\nimport bayesflow\n```\n\n**方式二：设置系统环境变量**\n```bash\nexport KERAS_BACKEND=jax\n```\n\n## 基本使用\n\n以下是最小可用示例，演示如何定义工作流、训练网络并生成诊断图：\n\n```python\nimport bayesflow as bf\n\n# 定义基本工作流\nworkflow = bf.BasicWorkflow(\n    inference_network=bf.networks.FlowMatching(),\n    inference_variables=[\"parameters\"],\n    inference_conditions=[\"observables\"],\n    simulator=bf.simulators.SIR()\n)\n\n# 在线训练模型\nhistory = workflow.fit_online(epochs=20, batch_size=32, num_batches_per_epoch=200)\n\n# 绘制默认诊断图\ndiagnostics = workflow.plot_default_diagnostics(test_data=300)\n```\n\n**说明：**\n- `inference_variables`：需要推断的参数。\n- `inference_conditions`：观测数据条件。\n- `simulator`：数据生成器（此处使用内置的 SIR 传染病模型）。\n- `fit_online`：执行在线训练，实时生成模拟数据进行学习。","某生物制药团队正在利用复杂的细胞动力学模拟器研发新药，需要从有限的实验观测数据中反推关键的生化反应参数。\n\n### 没有 bayesflow 时\n- **计算成本极高**：传统马尔可夫链蒙特卡洛（MCMC）方法对每个新样本都需运行数千次耗时模拟器，单次推断往往需要数天甚至数周。\n- **难以处理黑盒模型**：当细胞动力学方程过于复杂无法写出显式似然函数时，传统贝叶斯方法完全失效，团队被迫简化模型导致精度损失。\n- **重复劳动严重**：每当收集到一批新的实验数据，都必须重新从头开始漫长的采样过程，无法复用之前的计算资源。\n- **诊断门槛高**：缺乏自动化的收敛性诊断工具，研究人员需手动编写大量代码来验证结果可靠性，容易引入人为错误。\n\n### 使用 bayesflow 后\n- **实现瞬时推断**：利用 amortized（摊销）学习策略，bayesflow 训练一次神经网络后，对新数据的参数估计仅需毫秒级即可完成，效率提升万倍。\n- **无缝支持仿真推断**：直接对接任意 Python 编写的黑盒模拟器，无需推导似然函数即可进行高精度的基于仿真的推断（SBI）。\n- **一次训练多次复用**：训练好的神经估计器可反复用于后续所有新实验数据的分析，真正实现了“一次训练，终身受益”的工作流。\n- **内置智能诊断**：提供强大的生成式 AI 诊断功能和可视化接口，自动评估推断质量，让结果验证变得简单且可信。\n\nbayesflow 将原本需要数周的参数反推工作压缩至分钟级，让科学家能专注于生物学发现而非被计算瓶颈困扰。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbayesflow-org_bayesflow_77dcb1e1.png","bayesflow-org","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fbayesflow-org_e1fa3e7d.png","An organization for applications and extensions of amortized Bayesian inference.",null,"https:\u002F\u002Fgithub.com\u002Fbayesflow-org",[78,82,86,90,94,97,100],{"name":79,"color":80,"percentage":81},"Python","#3572A5",93.8,{"name":83,"color":84,"percentage":85},"Jupyter Notebook","#DA5B0B",4.3,{"name":87,"color":88,"percentage":89},"HTML","#e34c26",1.6,{"name":91,"color":92,"percentage":93},"Batchfile","#C1F12E",0.1,{"name":95,"color":96,"percentage":93},"Makefile","#427819",{"name":98,"color":99,"percentage":93},"TeX","#3D6117",{"name":101,"color":102,"percentage":103},"CSS","#663399",0,657,82,"2026-04-16T18:55:16","MIT","未说明","未说明 (取决于所选后端：JAX, PyTorch 或 TensorFlow)",{"notes":111,"python":112,"dependencies":113},"该工具必须安装至少一个机器学习后端（JAX、PyTorch 或 TensorFlow）才能运行，否则无法导入。推荐使用 JAX 以获得最佳性能。可以通过设置环境变量 'KERAS_BACKEND' 或在代码中指定来选择后端。版本 2.0+ 是基于 Keras 3 的重写版本，支持多后端，而旧版本仅基于 TensorFlow。","3.11 - 3.13",[114,115,116,117,118],"bayesflow>=2.0","keras>=3.0","jax (可选后端)","pytorch (可选后端)","tensorflow (可选后端)",[14,120],"其他",[122,123,124,125,126,127,128,129],"deep-learning","amortized-inference","bayesian-statistics","computational-modeling","generative-ai","generative-models","neural-networks","simulation-based-inference","2026-03-27T02:49:30.150509","2026-04-18T09:20:09.405705",[133,138,143,148,153,157],{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},39161,"如何在使用预模拟数据加载时解决 `ContinuousApproximator.sample()` 报错的问题？","当从磁盘加载预模拟数据而非动态生成数据集时，直接调用 `sample()` 可能会因适配器（adapter）未初始化而报错。推荐的解决方案是：不要将包装好的 `OfflineDataset` 对象直接保存为 pickle 文件，而是将原始模拟数据保存为 numpy 等格式。在加载数据后，再创建 `OfflineDataset` 对象。即：\"建议将任何预模拟数据以原始形式保存，仅在加载原始数据后才创建 `OfflineDataset` 对象。\"","https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow\u002Fissues\u002F255",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},39162,"使用 `TimeSeriesTransformer` 时遇到双向注意力机制（bidirectional）相关的配置错误怎么办？","这是一个已知的 bug。临时解决方法是在配置时将 `bidirectional` 参数设置为 `False`。该问题已在开发分支（dev branch）中修复，用户可以通过以下命令重新安装开发版来解决：`pip install --upgrade --no-deps --force-reinstall git+https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002Fbayesflow@Development`。","https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow\u002Fissues\u002F110",{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},39163,"如何在 BayesFlow 中实现神经摊销点估计（Amortized Point Estimation）？","该功能已在 PR #281 中实现。用户可以参考论文 \"Likelihood-free parameter estimation with neural Bayes estimators\" 以及相关的 R 包 `NeuralEstimators` 或 Julia 包 `NeuralEstimators.jl` 来理解其原理。在 BayesFlow 中，这通常涉及使用特定的推理网络回归到点估计值，并配合相应的损失函数进行训练。","https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow\u002Fissues\u002F121",{"id":149,"question_zh":150,"answer_zh":151,"source_url":152},39164,"训练过程中出现显存溢出（OOM）错误该如何处理？","如果在运行约 50-60 个 epoch 后遇到 OOM 错误，这通常是一个已知问题。请尝试升级到最新的开发版本（dev release），该问题在新版本中通常已得到修复。如果升级后问题仍然存在，请重新开启 Issue 反馈。","https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow\u002Fissues\u002F160",{"id":154,"question_zh":155,"answer_zh":156,"source_url":142},39165,"对于嵌套强化学习（RL）结构模型，应该选择 `InvariantNetwork` 还是 `TimeSeriesTransformer`？","如果模型需要记忆功能（memory），例如处理嵌套 RL 结构或时间序列数据，推荐使用 `TimeSeriesTransformer` 而不是 `InvariantNetwork`。`TimeSeriesTransformer` 能够更好地捕捉序列中的上下文信息和依赖关系。",{"id":158,"question_zh":159,"answer_zh":160,"source_url":147},39166,"如何评估摊销点估计器的频率学派有效性（frequentist validity）？","可以通过参数自助法（parametric bootstrap）来评估。具体做法是围绕一个名义参数值（如后验均值或中位数）构建分位数区间，然后计算该名义值落入这些自助区间的比例，以此量化预期的频率覆盖率。这与 Hermans 等人在相关论文中描述的过程类似，但是针对特定的点估计值而非整个参数空间的平均值。",[162,167,172,177,182,187,192,197,202,207,212,217,222,227,232,237,242,247,252],{"id":163,"version":164,"summary_zh":165,"released_at":166},315090,"v2.0.10","## ✨ 发行说明\n本次发布新增了参数化分布的混合得分，这些内容在 2.0.9 版本中缺失。此外，还对测试和发布工作流进行了一些小修复和改进，修正了文档，并设定了更智能的覆盖率目标。**祝您愉快地进行摊销计算！**\n\n## 🆕 新增功能\n- 参数化分布的混合得分\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow\u002Fcompare\u002Fv2.0.9...v2.0.10","2026-03-19T14:20:37",{"id":168,"version":169,"summary_zh":170,"released_at":171},315091,"v2.0.9","发布说明 ✨\n\n下一版 BayesFlow 带来了大幅重构的代码库和多项新功能。在 `> 2.0.8` 版本中保存的模型可能无法正确反序列化，因此建议新工作流升级到最新版本，而依赖预训练模型的现有工作流则应锁定至 `2.0.8`。从下一次发布开始，序列化将保持向后兼容。\n\n新增 🆕\n\n- 针对任意形状和数据类型（如图像、图结构）的极致灵活采样与推断接口\n- 极致灵活的扩散模型、流匹配模型及一致性模型\n- 适用于所有类扩散模型的指导机制与目标掩码\n- 针对不同掩码（注意力掩码、无分类器指导等）的极致灵活接口\n- 一套用于图像生成（参数到图像）和参数估计（图像到参数）的 SOTA UNet 主干网络，并附有专门的 [教程](https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow\u002Fblob\u002Fmain\u002Fexamples\u002FSpatial_Data_and_Parameters.ipynb)。\n- 新增教程，包括关于扩散模型的新 [视频教程](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=ZlcEkHXgF5k)\n- 用于 MCMC 集成的对比神经比率估计（NRE），作为 NLE 的替代方案\n- 通过图形近似器和图形模拟器接口实现的层次模型（目前仍处于初步实验阶段）\n- 网络集成功能，可轻松训练多种不同类型的数据摘要网络和\u002F或推断网络，并配有专门的 [教程](https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow\u002Fblob\u002Fmain\u002Fexamples\u002FEnsembles.ipynb)\n- 混合评分函数，用于构建更具表达力的参数化贝叶斯估计器\n\n变更 🔧\n\n- 将模型比较重新实现为评分规则估计的一个特例（即任意贝叶斯估计器）\n- 维护工作及大量内部优化 🧹\n- 提高了数据摘要网络和推断网络的测试覆盖率\n- 修复了一些小 bug\n\n一如既往，祝您建模愉快！欢迎分享您的成功案例或遇到的问题！","2026-03-17T23:59:07",{"id":173,"version":174,"summary_zh":175,"released_at":176},315092,"v2.0.8","发布说明 ✨\n\nBayesFlow 的下一个版本新增了大量新功能，主要围绕基于扩散模型（基于得分、流匹配、一致性）的模拟推断展开（详情请参阅 https:\u002F\u002Farxiv.org\u002Fabs\u002F2512.20685），同时还包含多项改进。\n\n新增 🆕\n\n- 扩散模型的指导采样支持。\n- 针对大型推断数据集的可选批处理采样，并提供进度跟踪和实际运行时间报告。\n- 为采样工作流添加了更多进度条。\n- 流匹配新增选项，包括条件最优传输。\n- 更加稳健的 C2ST 检验，以及新的诊断工具。\n\n变更 🔧\n\n- 改进了扩散模型求解器。\n- 极大地优化了类扩散模型（扩散、流匹配、一致性）的默认骨干网络。预计性能将大幅提升！（对于加载先前版本训练的旧模型而言，属于重大变更）\n- 改进了推断阶段的内部处理机制，支持任意子网络以灵活的方式处理目标、条件和时间变量。\n- 扩展了采样的灵活性（例如，时变参数、图像及其他结构化目标\u002F条件），并新增了 `sample_shape` 参数。\n\n维护 🧹\n\n- 提高了测试覆盖率。\n- 修复了多个 bug。\n\n一如既往，祝您高效使用！","2026-01-28T16:02:39",{"id":178,"version":179,"summary_zh":180,"released_at":181},315093,"v2.0.7","## 变更内容\n* 联合校准的诊断信息更加丰富。任意数量的变量对图显示效果更好。\n* DeepSets 和扩散模型的默认设置得到优化。\n* 自动选择后端。除非必要，无需再手动操作 `os.environ`！\n* 修复了一些小 bug。\n* 新增关于空间数据的教程。","2025-08-27T07:48:05",{"id":183,"version":184,"summary_zh":185,"released_at":186},315094,"v2.0.6","- 现在可以在 `networks` 模块中直接使用多种基于分数的扩散模型。\n- ECDF 校准图支持任意检验统计量，以实现更丰富的诊断分析。\n- 适配器现已完全无状态，从而简化了标准化流程。\n- 新增模块 `augmentations` 将用于收集训练过程中应用的不可序列化变换。已加入用于鲁棒训练的 NNPE（Ward 等，2022），未来还将有更多内容！\n- 进行了一些小的 bug 修复，并优化了内部参数传递机制。\n- 现有两个新的教程笔记本，分别介绍似然学习和多模态推理。","2025-07-19T18:48:56",{"id":188,"version":189,"summary_zh":190,"released_at":191},315095,"v2.0.5-patch","## 变更内容\n\n- 修复了多输入网络和三维输入中标准化层的一个重要缺陷。\n- 新增了对数伽马统计量，以实现更有效的基于模拟的检验，该方法由以下研究者提出：Modrák, M., Moon, A. H., Kim, S., Bürkner, P., Huurre, N., Faltejsková, K., ... & Vehtari, A. (2025). 基于模拟的贝叶斯计算校准检验：检验量的选择会影响灵敏度。*Bayesian Analysis, 20(2)*, 461-488.","2025-07-02T09:11:46",{"id":193,"version":194,"summary_zh":195,"released_at":196},315096,"v2.0.4","# 🚀 BayesFlow v2.0.4 – 灵活性与稳定性\n\n我们很高兴地宣布 **BayesFlow v2.0.4** 的发布——这是一个包含大量稳定性改进、更智能的网络架构、扩散模型以及多模态推理工具的重大版本。\n\n---\n\n## ✨ 亮点\n\n### 🔁 推理中的扩散模型\n- 集成了遵循 Kingma 等人（2023）的灵活 `DiffusionModel` 实现\n- 新增了 **SDE 求解器** 和灵活的 **采样支持**。您可以尝试不同类型的扩散模型！\n- 统一了各类推理网络的行为，并移除了对 `subnet_kwargs` 的弃用\n\n### 🧠 更智能的网络与融合\n- 引入了用于通过晚期融合进行 **多模态学习** 的 `FusionNetwork`\n- 新增了 `Group` \u002F `Ungroup` 变换，以实现灵活的输入结构化\n- 重新设计了摘要\u002F推理网络的发现与调度方式\n\n### 🧪 模拟与数据处理\n- 添加了基于百分比切片的 `subsample()` 和 `take()` 变换\n- 包含了用于处理缺失值的 **NaN 替换变换**\n- 启用了 **批量模拟工具** 和新的数据增强策略\n- 改进了 **磁盘\u002F离线数据集** 的一致性，包括打乱顺序的控制\n- 允许对数据集进行任意数据增强，以便仅在训练期间应用特定变换\n\n### 📏 稳定性与标准化\n- 创建了新的 `Standardization` 层，现由近似器统一管理，无需有状态的适配器\n- 引入了 **移动均值\u002F方差跟踪**，并实现了稳定的零方差处理\n- 用稳健的 **CholeskyFactor** 估计替代了不稳定的 `PositiveDefinite` 连接，用于 MVN 近似分布\n- 修复了验证损失的聚合问题\n\n### 🧮 模型比较与近似器\n- 更好地处理了模型比较中的 **异构模拟器输出**\n- 重构了 **指标跟踪** 功能，支持训练\u002F验证集划分及自定义指标\n- 对所有近似器进行了简化，统一了 `.prepare_data()` 逻辑，并修复了 `log_prob` 相关问题\n- 序列化现在更加安全且在不同后端和训练阶段之间具有一致性\n\n---\n\n## 🧪 诊断、文档与开发工具\n- 新增教程：**似然估计**、**多模态模拟**，以及一本关于使用 BayesFlow 进行认知建模的书籍\n- 改进了 **成对散点图**，优化了间距和图例层次\n- 增加了新的笔记本，并完善了关于 **近似器**、**诊断工具** 和 **数据处理** 的文档\n- BayesFlow 现已正式支持 **Python 3.12**\n\n---\n\n## 🧰 内部改进\n- 自定义了 `Sequential` 模块，以解决 Keras 构建和序列化方面的问题\n- 构建了更健壮的测试套件，扩展了对变换、指标、网络和近似器的覆盖范围\n- 实现了更智能的网络调度和动态模拟器配置\n\n---\n\n## 🔧 破坏性变更与弃用\n- `standardize` 适配器变换应仅与预先计算好的位置参数和尺度参数一起使用。→ 请改用近似器内置的新标准化工具！\n- 已弃用 `approx.summaries` → 请改用 `approx.summarize` 代替\n-","2025-06-18T07:44:20",{"id":198,"version":199,"summary_zh":200,"released_at":201},315097,"v2.0.3","🚀 **BayesFlow v2.0.3 发行说明**\n\n⚠️ 重要提示：重大变更\n\n本次发布对序列化流程进行了重大调整，与 v2.0.2 及更早版本不兼容。使用旧版本 BayesFlow 保存的模型很可能无法在本版本中加载，但未来训练的模型将与此版本向后兼容。\n\n我们强烈建议您更新工作流，并参考更新后的文档，以确保平稳过渡。\n\n📚 文档更新\n\n对 README.md 进行了增强，包括：\n- 从 BayesFlow v1.x 迁移到 v2 的详细指南。\n- 关于破坏性变更及缺失功能（例如层次模型、MCMC）的明确警告。\n- 为希望实现与旧版功能对齐的用户提供指引。\n        [查看更改 →](https:\u002F\u002Fgithub.com\u002Fbayesflow-org\u002Fbayesflow\u002Fpull\u002F460)\n\n🔧 后端改进\n\n- 简化版本管理：`__version__` 现在通过 importlib.metadata 动态设置。\n- 移除了针对不支持包导入的冗余异常处理。\n\n🌀 转换器增强\n\n新特性：在多个转换器类中新增了对 `log_det_jac`（雅可比行列式的对数）的支持：\n- Constrain\n- Concatenate\n- Drop\n\nAdapter 类现在可在正向和逆向方法中选择性地返回 `log_det_jac` 以及转换后的数据。这些改进进一步增强了对涉及变量变换技术的概率建模工作流的支持。\n\n🧬 序列化改进\n\n- 对关键转换器类（AsSet、Broadcast、Constrain 等）应用了带有显式命名空间 `\"bayesflow.adapters\"` 的 `@serializable` 装饰器。这提高了整个库中对象序列化的一致性和可靠性，尤其适用于自定义流水线中的保存与加载操作。\n\n✅ 总结\n\n本次发布提升了易用性、可扩展性和转换器的稳健性，特别是对于使用高级转换器的用户而言。虽然引入了破坏性变更，但也为进一步的开发奠定了更加稳定的基础。敬请期待！","2025-05-05T22:38:42",{"id":203,"version":204,"summary_zh":205,"released_at":206},315098,"v2.0.2","- 增加更多测试，包括笔记本示例\n- 修复了 JAX 中的最优传输实现\n- 改进了推理网络和摘要网络的调度（用于工作流）\n- 使用混合分布作为潜在空间\n- 完善了 README 文件\n- 修复了在加载近似器时关于缺少 `compile_from_config` 的警告\n- 添加 NumFOCUS 合作机构信息\n- 添加问题模板\n- 移除了在自定义适配器中显式丢弃未使用变量的必要性","2025-04-26T12:54:18",{"id":208,"version":209,"summary_zh":210,"released_at":211},315099,"v2.0.1","- 修复了流匹配中最优传输的 bug\n- 导入速度提升 1200%\n- 改进了一致性模型的测试","2025-04-22T22:13:16",{"id":213,"version":214,"summary_zh":215,"released_at":216},315100,"v2.0.0","🎉 BayesFlow 2.0 is here! 🎉\r\n\r\nWe'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.\r\n\r\n🔥 What's New in v2.0?\r\n\r\n- Multi-backend support with Keras 3: Choose your favorite ML framework - JAX, PyTorch, or TensorFlow - and switch seamlessly.\r\n\r\n- Cleaner, faster API: New workflows and interfaces make it easier than ever to build, train, and evaluate your models.\r\n\r\n- More neural network architectures: A rich set of ready-to-use building blocks tailored for simulation-based inference.\r\n\r\n- Smarter, more flexible design: Refined from the ground up to align with the latest advances in generative AI and Bayesian modeling.\r\n\r\n🧠 What is BayesFlow?\r\n\r\nBayesFlow 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.\r\n\r\nCheck out the 3-step conceptual overview:\r\n\r\n- Choose your backend – thanks to Keras 3, you're free to use JAX, PyTorch, or TensorFlow.\r\n\r\n- Define your simulator – write your model in pure Python and generate data effortlessly.\r\n\r\n- Select your inference algorithm – train flexible neural networks to estimate what matters most.\r\n\r\n🚀 Getting Started Is Easy\r\n\r\n```py3\r\nimport bayesflow as bf\r\n\r\nworkflow = bf.BasicWorkflow(\r\n    inference_network=bf.networks.CouplingFlow(),\r\n    summary_network=bf.networks.TimeSeriesNetwork(),\r\n    inference_variables=[\"parameters\"],\r\n    summary_variables=[\"observables\"],\r\n    simulator=bf.simulators.SIR()\r\n)\r\n\r\nhistory = workflow.fit_online(epochs=15, batch_size=32, num_batches_per_epoch=200)\r\ndiagnostics = workflow.plot_default_diagnostics(test_data=300)\r\n```\r\n\r\n🧪 Check out our growing library of tutorials and notebooks, from basic regression to Bayesian experimental design. Even better - contribute your own!\r\n\r\n📦 Installation\r\n\r\nYou can install the latest version directly from PyPI or GitHub.\r\n\r\nAnd don’t forget to install a supported backend - recommend JAX for top performance 🚀\r\n\r\nBayesFlow 2.0 is fast, flexible, and freaking awesome. We can’t wait to see what you build with it.\r\n\r\nLet us know what you think, and if you create something cool - open a PR or share it with the community! 💙\r\n\r\nThe BayesFlow Team","2025-04-22T00:41:09",{"id":218,"version":219,"summary_zh":220,"released_at":221},315101,"v1.1.6","## What's Changed\r\n* Hotfix pip installation error with Apple Silicon by @marvinschmitt in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F155\r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fcompare\u002Fv1.1.5...v1.1.6","2024-03-19T10:44:07",{"id":223,"version":224,"summary_zh":225,"released_at":226},315102,"v1.1.5","## What's Changed\r\n* set label names in plot_recovery() by @levolz in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F102\r\n* Development by @stefanradev93 in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F103\r\n* add label_fontsize and value_fontsize by @LuSchumacher in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F106\r\n* Optimization: add setting for tqdm mininterval by @vpratz in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F108\r\n* add n_row and n_col argument where applicable by @LuSchumacher in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F109\r\n* fix some typos and out-of-sync docstrings by @daniel-habermann in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F111\r\n* add **kwargs to diagnostics.plot_recovery by @marvinschmitt in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F112\r\n* Merge with dev by @stefanradev93 in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F115\r\n* Minor improvements by @elseml in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F117\r\n* Update README.md with forum by @elseml in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F116\r\n* update tutorial notebook 1 by @rusty-electron in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F120\r\n* Minimal Fix for Broken Tests by @LarsKue in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F130\r\n* Drop Support for Python 3.9, Add Support for Python 3.11 by @LarsKue in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F132\r\n* fix tutorial notebook 1 toc links and update some text by @rusty-electron in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F136\r\n* Make diagnostic plots work with one-parameter models by @Kucharssim in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F137\r\n* Fix offline training for model comparison ignoring shared context by @elseml in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F139\r\n* README - update minimal example  by @vpratz in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F141\r\n* update TOCs of example notebooks by @rusty-electron in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F142\r\n* Bump up to Series 1.1.5 update by @stefanradev93 in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F143\r\n* add notebook: amortized point estimation by @vpratz in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F145\r\n* Bayes Estimators: Loss functions with flexible signature by @han-ol in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F147\r\n* Development by @stefanradev93 in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F150\r\n\r\n## New Contributors\r\n* @daniel-habermann made their first contribution in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F111\r\n* @rusty-electron made their first contribution in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F120\r\n* @LarsKue made their first contribution in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F130\r\n* @Kucharssim made their first contribution in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F137\r\n* @han-ol made their first contribution in https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fpull\u002F147\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fstefanradev93\u002FBayesFlow\u002Fcompare\u002Fv1.1.4...v1.1.5","2024-03-14T14:06:58",{"id":228,"version":229,"summary_zh":230,"released_at":231},315103,"v1.1.4","State of software at JOSS publication.","2023-09-12T16:16:38",{"id":233,"version":234,"summary_zh":235,"released_at":236},315104,"v1.1.3","1. Bugfix in ``SimulationMemory`` affecting the use of empty folders for initializing a ``Trainer``;\r\n2. Bugfix in ``Trainer.train_from_presimulation()`` for model comparison tasks;\r\n3. Added a classifier two-sample test (C2ST) function ``c2st`` in ``computational_utilities``.\r\n","2023-08-13T15:21:19",{"id":238,"version":239,"summary_zh":240,"released_at":241},315105,"v1.1.2","1. Bugfix related to training `SetTransformer` with induced points\r\n2. Bugfix for offline training of transformers with variable sizes\r\n3. Complete revamp of documentation, README, and tutorials","2023-07-16T10:18:03",{"id":243,"version":244,"summary_zh":245,"released_at":246},315106,"v1.1.1","Enable PyPI integration through GitHub workflows.","2023-06-22T16:55:38",{"id":248,"version":249,"summary_zh":250,"released_at":251},315107,"v1.1","Following multiple improvements and being actively used in multiple projects, the BayesFlow library is ready to move beyond the beta phase! \r\n\r\n**Features:**\r\n1. Added option for ``permutation='learnable'`` when creating an ``InvertibleNetwork``\r\n2. Added option for ``coupling_design in [\"affine\", \"spline\", \"interleaved\"]`` when creating an ``InvertibleNetwork``\r\n3. Simplified passing additional settings to the internal networks. For instance, you\r\ncan now simply do\r\n``inference_network = InvertibleNetwork(num_params=20, coupling_net_settings={'mc_dropout': True})``\r\nto get a Bayesian neural network.\r\n4. ``PMPNetwork`` has been added for model comparison according to findings in https:\u002F\u002Farxiv.org\u002Fabs\u002F2301.11873\r\n5. Publication-ready calibration diagnostic for expected calibration error (ECE) in a model comparison setting has been\r\nadded to ``diagnostics.py`` and is accessible as ``plot_calibration_curves()``\r\n6. A new module ``experimental`` has been added currently containing ``rectifiers.py``.\r\n7. Default settings for transformer-based architectures.\r\n8. Numerical calibration error using ``posterior_calibration_error()``\r\n\r\n**General Improvements:**\r\n1. Improved docstrings and consistent use of keyword arguments vs. configuration dictionaries\r\n2. Increased focus on transformer-based architectures as summary networks\r\n3. Figures resulting ``diagnostics.py`` have been improved and prettified\r\n4. Added a module ``sensitivity.py`` for testing the sensitivity of neural approximators to model misspecification\r\n5. Multiple bugfixes, including a major bug affecting the saving and loading of learnable permutations\r\n\r\nThe project now also features automatic PyPI publishing. :) ","2023-06-22T13:54:07",{"id":253,"version":254,"summary_zh":255,"released_at":256},315108,"v1.0.0-beta","Welcome to the Future!","2022-11-23T11:32:23"]