mixle.doe.trust_region module

Trust-region Bayesian optimization (TuRBO, Eriksson et al. 2019) for higher-dimensional problems.

Global GP-BO degrades in high dimensions: one global surrogate is hard to fit and the acquisition is over-exploratory. TuRBO instead keeps a trust region – a box centered on the best point – and runs the BO only inside it, via Thompson sampling. The box side length grows after consecutive improvements and shrinks after consecutive failures; when it collapses, the search restarts from a fresh design. This local, self-tuning focus makes BO work for tens of dimensions where global EI stalls.

turbo_minimize() is the optimization loop (it calls your objective); TrustRegion is the expand/shrink state if you want to drive the loop yourself. Both fit the torch GP surrogate.

class TrustRegion(dim, length=0.8, length_min=0.0078125, length_max=1.6, success_tol=3, failure_tol=0, _success=0, _failure=0)[source]

Bases: object

Expand/shrink state of a TuRBO trust region (side length in normalized [0, 1]^d coordinates).

The length doubles after success_tol consecutive improving batches and halves after failure_tol consecutive non-improving ones; collapsed is True once it drops below length_min and the caller should restart. failure_tol defaults to the dimension (Eriksson 2019).

Parameters:
dim: int
length: float = 0.8
length_min: float = 0.0078125
length_max: float = 1.6
success_tol: int = 3
failure_tol: int = 0
property collapsed: bool
update(improved)[source]

Record whether the latest batch improved the incumbent, and resize the region.

Parameters:

improved (bool)

Return type:

None

turbo_minimize(objective, bounds, *, n_init=None, max_evals=100, batch_size=1, maximize=False, n_candidates=None, seed=None, fit_kwargs=None)[source]

Optimize a black-box objective over bounds with TuRBO (trust-region BO).

Starts from a Latin-hypercube design of n_init points (default 2*d), then repeatedly fits a GP on the normalized data, draws Thompson candidates inside the current trust region, evaluates the best batch_size of them, and resizes the region by success/failure. On collapse it restarts from a new design. Runs until max_evals objective calls. Returns {'x', 'y', 'X', 'Y', 'n_restarts'} with the best point/value and the full history.

Parameters:
Return type:

dict[str, Any]