Prior acquisition function
smac.acquisition.function.prior_acquisition_function
#
PriorAcquisitionFunction
#
PriorAcquisitionFunction(
acquisition_function: AbstractAcquisitionFunction,
decay_beta: float,
prior_floor: float = 1e-12,
discretize: bool = False,
discrete_bins_factor: float = 10.0,
)
Bases: AbstractAcquisitionFunction
Weight the acquisition function with a user-defined prior over the optimum.
See "piBO: Augmenting Acquisition Functions with User Beliefs for Bayesian Optimization" by Carl Hvarfner et al. [HSSL22] for further details.
Parameters#
decay_beta: float
Decay factor on the user prior. A solid default value for decay_beta (empirically founded) is
scenario.n_trials
/ 10.
prior_floor : float, defaults to 1e-12
Lowest possible value of the prior to ensure non-negativity for all values in the search space.
discretize : bool, defaults to False
Whether to discretize (bin) the densities for continous parameters. Triggered for Random Forest models and
continous hyperparameters to avoid a pathological case where all Random Forest randomness is removed
(RF surrogates require piecewise constant acquisition functions to be well-behaved).
discrete_bins_factor : float, defaults to 10.0
If discretizing, the multiple on the number of allowed bins for each parameter.
Source code in smac/acquisition/function/prior_acquisition_function.py
__call__
#
Compute the acquisition value for a given configuration.
Parameters#
configurations : list[Configuration] The configurations where the acquisition function should be evaluated.
Returns#
np.ndarray [N, 1] Acquisition values for X
Source code in smac/acquisition/function/abstract_acquisition_function.py
update
#
update(model: AbstractModel, **kwargs: Any) -> None
Update the acquisition function attributes required for calculation.
This method will be called after fitting the model, but before maximizing the acquisition function. As an examples, EI uses it to update the current fmin. The default implementation only updates the attributes of the acquisition function which are already present.
Calls _update
to update the acquisition function attributes.
Parameters#
model : AbstractModel The model which was used to fit the data. kwargs : Any Additional arguments to update the specific acquisition function.