Bgolearn logo Bgolearn Playground

小白入门材料贝叶斯优化A beginner path to Bayesian optimization for materials

Bgolearn 乐园Bgolearn Playground

从“试很多次”变成“聪明地试下一次”:用少量实验数据训练代理模型,让不确定性和采集函数帮你推荐最值得做的材料候选。 Move from trying everything to choosing the next experiment wisely: train a surrogate model from limited data, then use uncertainty and acquisition functions to recommend high-value material candidates.

Bgolearn project mark
1小批量已有实验small measured batch
2模型预测和不确定性prediction plus uncertainty
3推荐下一轮候选next candidate

先把流程讲成人话Plain-language walkthrough first

把贝叶斯优化想成一位会做笔记的实验助手Think of Bayesian optimization as a lab assistant that keeps learning

它不是替你凭空发明材料,而是把你已经做过的实验整理成一张“会标出把握程度的地图”。地图越清楚,下一次实验就越像有方向的移动,而不是盲猜。 It does not invent materials from nothing. It turns your completed experiments into a map that also shows confidence. The clearer the map becomes, the more directed the next move feels.

点击右侧任一步,看数据在贝叶斯优化循环里怎么移动。 Click any step on the right to see how data moves through the loop.

去学习 Bgolearn 论文Learn from the Bgolearn paper
GP
像先画一张实验地图Like drawing the first lab map

1. 拟合 GP:用已知实验画地图1. Fit GP: draw a map from known experiments

高斯过程会看你已经测过的点,估计其他位置可能好不好。蓝线像“助手的猜测”,金色不确定性像“这里我还不太确定”。The Gaussian process looks at measured points and estimates untested regions. The blue curve is the assistant's guess; the gold band says where it is still unsure.

ACQ
像拿指南针选下一步Like using a compass for the next move

2. 生成推荐:在“可能好”和“还未知”之间取舍2. Recommend: balance promising and unknown places

采集函数会给候选排序。它既看预测性能,也看不确定性:有时去最高点附近,有时去还没摸清的区域。The acquisition function ranks candidates. It considers predicted performance and uncertainty: sometimes it goes near the best region, sometimes into blind spots.

LAB
像真正进实验室验证Like actually testing in the lab

3. 执行实验:把推荐变成真实读数3. Run experiment: turn a suggestion into a measurement

推荐只是“值得一试”的建议。执行实验后,系统会显示 GP 原本怎么预测、实际结果是多少、误差有多大。A recommendation is only a worthwhile suggestion. After the experiment, the page shows the GP prediction, the measured value, and the prediction error.

DATA
像把新结果写回实验记录本Like writing the result back into the notebook

4. 加入数据:让下一轮推荐更聪明4. Add data: make the next recommendation smarter

只有点击“加入数据”后,新实验才会进入训练集。下一轮重新拟合 GP,地图更新,推荐也会跟着改变。Only after clicking Add data does the measurement enter the training set. The next GP fit updates the map, so the recommendation changes too.

贝叶斯优化到底在做什么?What is Bayesian optimization doing?

材料实验常常昂贵、缓慢、样本少。贝叶斯优化把已有实验变成一张“带不确定性的地图”,再决定下一步去哪里探索。 Materials experiments are often costly, slow, and data-limited. Bayesian optimization turns existing measurements into an uncertainty-aware map, then decides where to explore next.

1

描述材料Describe materials

把成分、工艺、温度、结构特征等转成模型能读懂的变量。Convert composition, process, temperature, and structure descriptors into model-readable variables.

2

学习已知数据Learn known data

用代理模型预测性能,同时估计“这里我有多不确定”。Use a surrogate model to predict performance and estimate uncertainty at the same time.

3

选择下一次实验Choose the next experiment

采集函数按不同策略给候选排序:有的偏向提升性能,有的偏向降低未知区域。An acquisition function ranks candidates by strategy: some favor performance gain, while others reduce unknown regions.

4

加入结果再迭代Add results and repeat

新实验结果回到数据表,模型更新,推荐会越来越聚焦。The new measurement goes back into the table, the model updates, and recommendations become more focused.

材料寻优游戏:用有限预算找到冠军材料Materials Quest: find the champion under budget

你是一间材料实验室的产品负责人。每一次点击代表真实实验室的一轮:高斯过程根据已有样本拟合性能地图,采集函数给候选打分,然后你花掉 1 次预算测量一个材料。目标是在预算耗尽前完成足够轮次的主动学习,并找到性能超过任务阈值的候选。 You are the product lead of a materials lab. Each click is one lab round: a Gaussian process fits a performance map from measured samples, an acquisition function scores candidates, and you spend one budget unit to measure a material. Your goal is to complete enough active-learning rounds and beat the mission target before the budget runs out.

Lead-free solder sprint
10剩余实验预算Budget left
L1实验室等级Lab level
0研发积分R&D score
RUN任务状态Mission state
拟合函数是什么?What fits the curve?这里使用高斯过程回归,RBF 核会让相近材料有相近性能。This uses Gaussian process regression with an RBF kernel, so nearby materials tend to have similar properties.
一轮怎么拆开?How is one round split?先拟合 GP,再生成推荐,接着执行实验,最后把结果加入训练集。Fit the GP, generate recommendations, run the experiment, then add the result to training data.
怎么玩更高分?How to score higher?早期多探索,发现高性能区后切换到 EI/UCB 收割。Explore early, then switch to EI/UCB once a promising region appears.
真实性能True performance 模型预测Model prediction 不确定性Uncertainty 采集分数Acquisition score 初始数据Initial data 加入数据Added data 待加入结果Pending result

推荐日志Recommendation log

三个核心概念Three core ideas

把贝叶斯优化拆开看,其实就是模型、信心和决策规则。At beginner level, Bayesian optimization is model, confidence, and a decision rule.

代理模型Surrogate model

本游戏里的拟合函数是高斯过程回归。它用 RBF 核表达“相近材料可能性能相近”,每轮实验后重新计算后验均值和不确定性。This game uses Gaussian process regression. Its RBF kernel encodes that nearby materials may have similar properties, then recomputes posterior mean and uncertainty after every experiment.

不确定性Uncertainty

模型不仅给出预测值,还告诉你哪些区域“没把握”。高不确定区域可能藏着惊喜。The model gives both prediction and confidence. Regions with high uncertainty may hide useful surprises.

采集函数Acquisition function

采集函数不是只有一种。它把模型的预测值、不确定性、当前最好结果和策略偏好转成候选排序。分数最高的位置,才会成为下一轮实验建议。There is not only one acquisition function. It turns prediction, uncertainty, current best value, and strategy preference into a candidate ranking. The top-ranked candidate becomes the next experiment.

教学简化例子:UCB = mean + k * uncertaintyTeaching simplification: UCB = mean + k * uncertainty
UCB

直接奖励高预测和高不确定性。k 越大,越敢探索未知区域。Rewards high prediction and uncertainty. Larger k explores unknown regions more.

EI

关心“比当前最好结果还能提升多少”的期望值,常用于性能最大化。Looks at the expected gain over the current best result, common for maximization.

PI

关心“超过当前最好结果的概率”,更像是在找成功率高的位置。Looks at the probability of beating the current best, favoring likely wins.

KG / PES

更重视信息价值:这次实验能让我们对全局最优了解多少。Focuses more on information value: how much this experiment teaches about the global optimum.

材料优化中的真实流程A real materials optimization workflow

  • 输入:Input: 候选材料表、已测训练数据、目标性能。candidate table, measured training data, target property.
  • 建模:Model: 学习变量和性能之间的关系,并保留预测不确定性。learn the relation between descriptors and performance while keeping uncertainty.
  • 推荐:Recommend: 根据 EI、UCB、PI、KG、PES 等采集函数排序候选。rank candidates with EI, UCB, PI, KG, PES, and related acquisition functions.
  • 迭代:Iterate: 测量推荐样本,把结果加入训练集,进入下一轮。measure suggested candidates, add results to the training set, and continue.
Bgolearn workflow diagram

Bgolearn 相关资源Bgolearn resources

Bgolearn 是面向材料发现的 Python 贝叶斯全局优化框架,支持回归、分类、主动学习、虚拟筛选和多种采集函数。 Bgolearn is a Python Bayesian global optimization framework for materials discovery, supporting regression, classification, active learning, virtual screening, and multiple acquisition functions.

安装Install

pip install Bgolearn

PyPI

在线手册Manual

查看接口、示例和使用说明。Read APIs, examples, and usage notes.

bgolearn.netlify.app

论文引用Paper

Bgolearn: a unified Bayesian optimization framework for accelerating materials discovery.Bgolearn: a unified Bayesian optimization framework for accelerating materials discovery.

DOI

入门阅读Beginner reading

从论文了解 Bgolearn 的整体框架、采集函数和材料发现应用。Read the paper for Bgolearn's framework, acquisition functions, and materials-discovery use cases.

arXiv:2601.06820

本地界面Local UI

python bgolearn_ui.py
然后打开 127.0.0.1:8787。Then open 127.0.0.1:8787.

查看脚本View script

TabularLab

轻量级表格机器学习工具包,可作为桌面应用或浏览器应用使用,支持回归、分类、聚类、可视化、预测和结果导出。A lightweight toolkit for tabular machine learning. It can be used as a desktop app or opened in a browser, and supports regression, classification, clustering, visualization, prediction, and result export.

GitHub

PlotEverything

轻量级科研绘图工作台,可从表格数据创建论文风格图、显示晶体结构、模拟 XRD、排版多面板图并导出最终图片。A lightweight scientific figure workspace. It helps users create publication-style figures from spreadsheet data, display crystal structures, simulate XRD patterns, arrange multi-panel figures, and export final images without writing plotting code.

GitHub

推荐引用格式Recommended citation

如果 Bgolearn 支持了你的研究,请引用以下论文。If Bgolearn supports your research, please cite the paper below.

@article{Cao2026Bgolearn,
  author    = {Bin Cao and Jie Xiong and Jiaxuan Ma and Yuan Tian and Yirui Hu and Mengwei He and Longhan Zhang and Jiayu Wang and Jian Hui and Li Liu and Dezhen Xue and Turab Lookman and Jun Wang and Tong-Yi Zhang},
  title     = {Bgolearn: a unified Bayesian optimization framework for accelerating materials discovery},
  journal   = {npj Computational Materials},
  year      = {2026},
  doi       = {10.1038/s41524-026-02226-3},
  issn      = {2057-3960},
  publisher = {Springer Nature},
  url       = {https://doi.org/10.1038/s41524-026-02226-3}
}