Add BAxUS generator for high-dimensional Bayesian optimization - #452
Add BAxUS generator for high-dimensional Bayesian optimization#452gian21391 wants to merge 3 commits into
Conversation
|
Hi Gianluca, Without reviewing the PR, I will say this quite plainly: we are not going to accept code that is direct Claude slop. Obviously everyone is using agentic harnesses. I myself go through a disturbing amount of tokens every month. But to avoid sloppification, you have to fight against the absurd 'gazillion tests + defensive check everything' style of default Claude. |
|
Hi Nikita, fair enough. I have pushed a commit to simplify the code. I think it is pretty readable now but I would like to do one more pass to check whether the design can be improved. The tests are extensive but not absurd anymore. I have tried to keep the coverage to 99%. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Thanks, and no worries getting internals too polished - my biggest concern was/is docs text, because that is user-facing maybe-a-bit-verbose-opus-smell part. I'll run it through my opinionated fable/sol review loop before merge as well. |
Implements BAxUS (Papenmeier et al., NeurIPS 2022) for single-objective problems where most input dimensions are irrelevant. Optimization happens inside a sparse random embedding that expands whenever the trust region collapses, so a run starts cheap in a few dimensions and only pays for more as it earns them.
On a 100-D sphere with 3 effective dimensions the embedding grows
2 → 8 → 32over 25 steps. The generator draws its own Sobol seed points, so norandom_evaluateis needed first. Seteval_budgetto the number of planned evaluations — without it the reference expansion schedule is replaced by aceil(target_dim / 2)heuristic that expands far more slowly.Scope — narrower than the other Bayesian generators
The GP lives in the embedded subspace rather than in
VOCSspace, so anything keyed toVOCS-space columns can't be honored. Constraints, observables, discrete and contextual variables,fixed_features,max_travel_distances,custom_objective,n_interpolate_pointsand turbo controllers are all rejected at construction rather than silently ignored. It generates one candidate at a time, andvisualize_modelraises.Deviations from the reference
target_dim_initis a user knob rather than derived from input dimensionality; the acquisition is the inherited analytic LogEI over the trust-region box rather than Thompson sampling over a masked candidate set; and data not generated through the current embedding is least-squares projected into target space. All three are documented in the module docstring anddocs/algorithms.md.Test
119 tests in
xopt/tests/generators/bayesian/test_baxus.py. Beyond ordinary coverage it pins: a_TutorialBaxusStateoracle transcribed from the BoTorch tutorial that cross-checks the budget-aware failure-tolerance schedule; checkpoint integrity across dump/restore cycles; trust-region box geometry and that candidates come from the acquisition rather than a constant; lengthscale-weight normalization attarget_dimup to 1200, where the naive geometric-mean form underflows; NaN and failed-evaluation ingestion; and every rejected-option path.Docs:
docs/algorithms.mdentry, API reference page, README/index entries, and a runnable notebook covering the 100-D example plus checkpoint/resume.