syne_tune.optimizer.schedulers.searchers.bayesopt.models.model_base module

class syne_tune.optimizer.schedulers.searchers.bayesopt.models.model_base.BasePredictor(state, active_metric=None, filter_observed_data=None)[source]

Bases: Predictor

Base class for (most) Predictor implementations, provides common code.

property filter_observed_data: Callable[[Dict[str, int | float | str]], bool] | None
set_filter_observed_data(filter_observed_data)[source]
predict_mean_current_candidates()[source]

Returns the predictive mean (signal with key ‘mean’) at all current candidates in the state (observed, pending).

If the hyperparameters of the surrogate model are being optimized (e.g., by empirical Bayes), the returned list has length 1. If its hyperparameters are averaged over by MCMC, the returned list has one entry per MCMC sample.

Return type:

List[ndarray]

Returns:

List of predictive means

current_best()[source]

Returns the so-called incumbent, to be used in acquisition functions such as expected improvement. This is the minimum of predictive means (signal with key “mean”) at all current candidate locations (both state.trials_evaluations and state.pending_evaluations). Normally, a scalar is returned, but if the model supports fantasizing and the state contains pending evaluations, there is one incumbent per fantasy sample, so a vector is returned.

If the hyperparameters of the surrogate model are being optimized (e.g., by empirical Bayes), the returned list has length 1. If its hyperparameters are averaged over by MCMC, the returned list has one entry per MCMC sample.

Return type:

List[ndarray]

Returns:

Incumbent, see above