一键导入
bayesian-optimization
Design and run Bayesian optimization or adaptive sampling loops for expensive, noisy, multivariate, or non-convex measurement problems.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Design and run Bayesian optimization or adaptive sampling loops for expensive, noisy, multivariate, or non-convex measurement problems.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | bayesian-optimization |
| description | Design and run Bayesian optimization or adaptive sampling loops for expensive, noisy, multivariate, or non-convex measurement problems. |
Use Bayesian optimization (BO) when the user needs to optimize or adaptively sample an expensive black-box process and each measurement has meaningful cost. Good uses include microscope focus optimization, adaptive scanning of a sample, searching for a region with a target property, tuning instrument parameters, or optimizing a non-convex response over several controllable variables.
Do not default to BO for a simple deterministic one-dimensional problem unless the user asks for it or measurements are expensive enough to justify the overhead. For simple cases, suggest a direct scan, line search, grid search, or local optimizer if that would be clearer and cheaper.
Before designing or launching BO, identify the problem type and the constraints. Keep asking the user until the required information is clear.
Required information:
If the task is actually adaptive sampling, do not optimize blindly. Adaptive sampling usually aims to learn important sample structure under a point budget, not merely to find the highest observed value.
Explain the design choices to the user before launching the loop. At minimum, state the model, kernel, noise treatment, acquisition function, startup design, and stopping rule.
Model and kernel:
[0, 1] internally and standardize outputs before
fitting. Report suggested points in the user's original units.Noise:
Acquisition:
Startup data:
max(5, 2 * d) initial observations for
d continuous dimensions. Increase this when the space is noisy, highly
anisotropic, or constrained.Stopping:
Before running the first suggestion, tell the user:
If the user asks for a fully automated measurement loop, also state how failed measurements, out-of-bounds suggestions, instrument limits, and user interrupts will be handled.
update: append new observations and optional measurement noise.suggest: fit/update the GP and return the next point or batch of points.Use a high-level BO library unless the user explicitly requests an implementation
from scratch. BoTorch is recommended. If BoTorch is unavailable, do not silently
change the project environment. Ask before installing persistent dependencies, or
use a temporary command such as uv run --with botorch --with gpytorch ... when
that is acceptable for the task.
An example BoTorch CLI is available at:
packages/eaa-core/src/eaa_core/skills/bayesian-optimization/examples/botorch_ei_cli.py
It demonstrates a reusable state-file workflow:
uv run python packages/eaa-core/src/eaa_core/skills/bayesian-optimization/examples/botorch_ei_cli.py init \
--state bo_state.json \
--var x 0 1 \
--var y 0 1 \
--min-initial 6
uv run python packages/eaa-core/src/eaa_core/skills/bayesian-optimization/examples/botorch_ei_cli.py suggest \
--state bo_state.json
uv run python packages/eaa-core/src/eaa_core/skills/bayesian-optimization/examples/botorch_ei_cli.py update \
--state bo_state.json \
--x 0.25 0.75 \
--y 1.42 \
--noise-std 0.05
Use this script as a starting point, then adapt only the objective-specific parts: bounds, variable names, measurement interface, acquisition choice, constraints, and diagnostics. Keep the state file as the source of truth during the run.
Create or review external MCP server repositories for EAA-compatible instrument-control tools, including image artifact payloads, get_attribute_payload, and safe execution patterns such as Bluesky Queue Server gateways, existing execution-server gateways, or MCP-gateway/ZMQ-worker separation.
Procedure and instructions for focusing a scanning microscope using the landmark feature line scan method.
Monitor a certain object or state according to the instructions of the user using sleep functions.
Procedure for searching for a region of interest in a sample using microscope image acquisition tools during general chat.
Instructions for estimating translational shift between two images.
Instructions for checking a line scan.