Confidence bound
smac.acquisition.function.confidence_bound
#
AbstractConfidenceBound
#
AbstractConfidenceBound(
beta: float = 1.0,
nu: float = 1.0,
update_beta: bool = True,
beta_scaling_srinivas: bool = False,
)
Bases: AbstractAcquisitionFunction
Computes the lower or upper confidence bound for a given x over the best so far value as acquisition value.
Example for LCB (UCB adds the variance term instead of subtracting it):
\(LCB(X) = \mu(\mathbf{X}) - \sqrt{\beta_t}\sigma(\mathbf{X})\) SKKS10.
with
\(\beta_t = 2 \log( |D| t^2 / \beta)\) \(\text{Input space } D\)
\(\text{Number of input dimensions } |D|\)
\(\text{Number of data points } t\)
\(\text{Exploration/exploitation tradeoff } \beta\)
Returns -LCB(X) as the acquisition_function optimizer maximizes the acquisition value.
| PARAMETER | DESCRIPTION |
|---|---|
beta
|
Controls the balance between exploration and exploitation of the acquisition function.
TYPE:
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
_beta |
Exploration-exploitation trade-off parameter.
TYPE:
|
_num_data |
Number of data points seen so far.
TYPE:
|
_bound_type |
Type of Confidence Bound. Either UCB or LCB. Set in child class.
TYPE:
|
_update_beta |
Whether to update beta or not.
TYPE:
|
_beta_scaling_srinivas |
Whether to use the beta scaling according to [0, 1].
TYPE:
|
References
[0] Srinivas, Niranjan, et al. "Gaussian process optimization in the bandit setting: No regret and experimental design." arXiv preprint arXiv:0912.3995 (2009). or not. [1] Makarova, Anastasia, et al. "Automatic Termination for Hyperparameter Optimization." First Conference on Automated Machine Learning (Main Track). 2022.
Source code in smac/acquisition/function/confidence_bound.py
model
property
writable
#
model: AbstractModel | None
Return the used surrogate model in the acquisition function.
__call__
#
Compute the acquisition value for a given configuration.
| PARAMETER | DESCRIPTION |
|---|---|
configurations
|
The configurations where the acquisition function should be evaluated.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
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.
| PARAMETER | DESCRIPTION |
|---|---|
model
|
The model which was used to fit the data.
TYPE:
|
kwargs
|
Additional arguments to update the specific acquisition function.
TYPE:
|
Source code in smac/acquisition/function/abstract_acquisition_function.py
LCB
#
LCB(
beta: float = 1.0,
nu: float = 1.0,
update_beta: bool = True,
beta_scaling_srinivas: bool = False,
)
Bases: AbstractConfidenceBound
Computes the lower confidence bound for a given x over the best so far value as acquisition value.
\(LCB(X) = \mu(\mathbf{X}) - \sqrt{\beta_t}\sigma(\mathbf{X})\) SKKS10.
with
\(\beta_t = 2 \log( |D| t^2 / \beta)\)
\(\text{Input space } D\)
\(\text{Number of input dimensions } |D|\)
\(\text{Number of data points } t\)
\(\text{Exploration/exploitation tradeoff } \beta\)
Returns -LCB(X) as the acquisition_function optimizer maximizes the acquisition value.
| PARAMETER | DESCRIPTION |
|---|---|
beta
|
Controls the balance between exploration and exploitation of the acquisition function.
TYPE:
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
_beta |
Exploration-exploitation trade-off parameter.
TYPE:
|
_num_data |
Number of data points seen so far.
TYPE:
|
_bound_type |
Type of Confidence Bound. Either UCB or LCB.
TYPE:
|
Source code in smac/acquisition/function/confidence_bound.py
model
property
writable
#
model: AbstractModel | None
Return the used surrogate model in the acquisition function.
__call__
#
Compute the acquisition value for a given configuration.
| PARAMETER | DESCRIPTION |
|---|---|
configurations
|
The configurations where the acquisition function should be evaluated.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
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.
| PARAMETER | DESCRIPTION |
|---|---|
model
|
The model which was used to fit the data.
TYPE:
|
kwargs
|
Additional arguments to update the specific acquisition function.
TYPE:
|
Source code in smac/acquisition/function/abstract_acquisition_function.py
UCB
#
UCB(
beta: float = 1.0,
nu: float = 1.0,
update_beta: bool = True,
beta_scaling_srinivas: bool = False,
)
Bases: AbstractConfidenceBound
Computes the upper confidence bound for a given x over the best so far value as acquisition value.
\(UCB(X) = \mu(\mathbf{X}) + \sqrt{\beta_t}\sigma(\mathbf{X})\) SKKS10.
with
\(\beta_t = 2 \log( |D| t^2 / \beta)\)
\(\text{Input space } D\)
\(\text{Number of input dimensions } |D|\)
\(\text{Number of data points } t\)
\(\text{Exploration/exploitation tradeoff } \beta\)
Returns -UCB(X) as the acquisition_function optimizer maximizes the acquisition value.
| PARAMETER | DESCRIPTION |
|---|---|
beta
|
Controls the balance between exploration and exploitation of the acquisition function.
TYPE:
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
_beta |
Exploration-exploitation trade-off parameter.
TYPE:
|
_num_data |
Number of data points seen so far.
TYPE:
|
_bound_type |
Type of Confidence Bound. Either UCB or LCB.
TYPE:
|
Source code in smac/acquisition/function/confidence_bound.py
model
property
writable
#
model: AbstractModel | None
Return the used surrogate model in the acquisition function.
__call__
#
Compute the acquisition value for a given configuration.
| PARAMETER | DESCRIPTION |
|---|---|
configurations
|
The configurations where the acquisition function should be evaluated.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
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.
| PARAMETER | DESCRIPTION |
|---|---|
model
|
The model which was used to fit the data.
TYPE:
|
kwargs
|
Additional arguments to update the specific acquisition function.
TYPE:
|