bayesian-optimization
Route BayesianOptimization package tasks for black-box Bayesian optimization, HPO, acquisition functions, constraints, typed domains, domain reduction, and checkout maintenance.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- bayesian-optimization
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Route BayesianOptimization package tasks for black-box Bayesian optimization, HPO, acquisition functions, constraints, typed domains, domain reduction, and checkout maintenance.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/repo-provenance.md2.3 KB
- 参考文档references/repo-routing-metadata.json430 B
- 参考文档references/troubleshooting.md5.5 KB
- 脚本scripts/check_env.py5.7 KB
03 SKILL.md 正文
BayesianOptimization Repo Skill
Use this repo skill when a user asks about the bayesian-optimization package,
its bayes_opt import, Gaussian-process Bayesian optimization, black-box
function maximization, small hyperparameter optimization, acquisition functions,
constraints, typed/categorical parameters, sequential domain reduction, or
maintaining this package's source checkout.
This skill is self-contained. Do not send future agents to original repository notebooks or examples for package usage; use the bundled references and scripts below. Checkout-only test and docs commands are confined to the maintainer sub-skill.
Install and import baseline
Package users normally install one of:
pip install bayesian-optimization
conda install -c conda-forge bayesian-optimization
Minimal import check:
from bayes_opt import BayesianOptimization
def objective(x, y):
return -x**2 - (y - 1.0) ** 2 + 1.0
optimizer = BayesianOptimization(
f=objective,
pbounds={"x": (-2.0, 2.0), "y": (-3.0, 3.0)},
random_state=1,
verbose=0,
)
optimizer.maximize(init_points=1, n_iter=1)
assert optimizer.max is not None
For an environment-level diagnostic, run
scripts/check_env.py. Add --run-subskill-smokes when
you want it to execute the bundled tiny smoke helpers as well.
Route map
Core optimizer and HPO workflows
Read sub-skills/optimizer-workflows/SKILL.md
when the task involves:
- creating
BayesianOptimization(f=..., pbounds=...); maximize,max,res,probe,register,suggest, orrandom_sample;- manual ask-tell loops for external evaluations;
- saving/loading JSON state, changing bounds, tuning GP parameters, or using
predict; - converting a loss into a maximization target;
- small scikit-learn HPO recipes and validation.
Acquisition control
Read sub-skills/acquisition-control/SKILL.md
when the task involves:
- UCB, Expected Improvement, Probability of Improvement, Constant Liar, or GPHedge;
- choosing exploration/exploitation settings such as
kappa,xi,exploration_decay, andexploration_decay_delay; - lower-level acquisition
suggest(gp, target_space, n_random, n_smart, ...); - asynchronous/batch-like suggestions, acquisition portfolios, or custom
AcquisitionFunctionsubclasses; - acquisition errors such as empty target spaces, invalid
xi/kappa, staleUtilityFunctionsnippets, and constraint incompatibility.
Advanced domain features
Read sub-skills/advanced-domain-features/SKILL.md
when the task involves:
- SciPy
NonlinearConstraintandConstraintModel; - known constrained observations with
constraint_value; - integer bounds
(low, high, int), categorical bounds, or customBayesParametersubclasses; TargetSpacearray/dict conversion, masks, and typed kernel transforms;SequentialDomainReductionTransformer,minimum_window, and all-float domain reduction limitations.
Repository maintenance
Read sub-skills/repo-maintenance/SKILL.md
only when the user is editing or validating a bayesian-optimization source
checkout. It covers focused pytest selection, Ruff/lint commands, notebook/docs
checks, CI Python/NumPy matrix behavior, dependency markers, build validation,
and release/publish boundaries. Do not use it for ordinary package usage.
Cross-cutting references
references/troubleshooting.md: install, import, dependency marker, no-CLI, old API, and route-selection failures that cut across sub-skills.references/repo-provenance.md: source commit, package version, evidence paths, and refresh baseline for this skill.references/repo-routing-metadata.json: structured metadata consumed by DisCo's managed repo-skills router importer.
Quick decisions
- The package maximizes. If the real metric is a loss, return
-loss. pboundsnames must match objective and constraint keyword arguments.- No GPU backend is required for selected package workflows; this is a CPU scientific Python package built on NumPy, SciPy, and scikit-learn.
- There is no public package CLI. Use Python APIs and bundled diagnostic scripts.
- Avoid old code that calls
optimizer.suggest(UtilityFunction(...)); current v3.3.x optimizer-levelsuggest()takes no acquisition argument. Pass an acquisition instance into the optimizer constructor instead. - Use dict parameters for clarity, especially with typed or categorical
domains. Raw arrays follow
pboundsinsertion order and expanded internal dimensions.
Handoff checklist
Before answering a user or running a diagnostic, identify:
- Is this package usage or source-checkout maintenance?
- Is the objective unconstrained or constrained?
- Are parameters ordinary floats, typed integers/categories, or custom domain objects?
- Is acquisition selection part of the task, or can the optimizer default be used?
- Does the requested check require only CPU runtime dependencies, or a broader development environment for notebooks/docs/lint?
Then load the smallest matching sub-skill and use its bundled references and scripts.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).