smac.optimizer.acquisition

Classes

AbstractAcquisitionFunction(model)

Abstract base class for acquisition function.

EI(model[, par])

Computes for a given x the expected improvement as acquisition value.

EIPS(model[, par])

IntegratedAcquisitionFunction(model, ...)

Marginalize over Model hyperparameters to compute the integrated acquisition function.

LCB(model[, par])

LogEI(model[, par])

PI(model[, par])

PriorAcquisitionFunction(model, ...[, ...])

Weight the acquisition function with a user-defined prior over the optimum.

TS(model[, par])

class smac.optimizer.acquisition.AbstractAcquisitionFunction(model)[source]

Bases: object

Abstract base class for acquisition function.

Parameters

model (BaseEPM) – Models the objective function.

model
logger
__call__(configurations)[source]

Computes the acquisition value for a given X.

Parameters

configurations (list) – The configurations where the acquisition function should be evaluated.

Returns

acquisition values for X

Return type

np.ndarray(N, 1)

update(**kwargs)[source]

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 acqusition function which are already present.

Parameters

kwargs (Any) –

Return type

None

class smac.optimizer.acquisition.EI(model, par=0.0)[source]

Bases: smac.optimizer.acquisition.AbstractAcquisitionFunction

Computes for a given x the expected improvement as acquisition value.

\(EI(X) := \mathbb{E}\left[ \max\{0, f(\mathbf{X^+}) - f_{t+1}(\mathbf{X}) - \xi \} \right]\), with \(f(X^+)\) as the best location.

class smac.optimizer.acquisition.EIPS(model, par=0.0)[source]

Bases: smac.optimizer.acquisition.EI

class smac.optimizer.acquisition.IntegratedAcquisitionFunction(model, acquisition_function, **kwargs)[source]

Bases: smac.optimizer.acquisition.AbstractAcquisitionFunction

Marginalize over Model hyperparameters to compute the integrated acquisition function.

See “Practical Bayesian Optimization of Machine Learning Algorithms” by Jasper Snoek et al. (https://papers.nips.cc/paper/4522-practical-bayesian-optimization-of-machine-learning-algorithms.pdf) for further details.

update(**kwargs)[source]

Update the acquisition functions values.

This method will be called if the model is updated. E.g. entropy search uses it to update its approximation of P(x=x_min), EI uses it to update the current fmin.

This implementation creates an acquisition function object for each model to integrate over and sets the respective attributes for each acquisition function object.

Parameters
  • model (BaseEPM) – The model needs to implement an additional attribute models which contains the different models to integrate over.

  • kwargs (Any) –

Return type

None

class smac.optimizer.acquisition.LCB(model, par=1.0)[source]

Bases: smac.optimizer.acquisition.AbstractAcquisitionFunction

class smac.optimizer.acquisition.LogEI(model, par=0.0)[source]

Bases: smac.optimizer.acquisition.AbstractAcquisitionFunction

class smac.optimizer.acquisition.PI(model, par=0.0)[source]

Bases: smac.optimizer.acquisition.AbstractAcquisitionFunction

class smac.optimizer.acquisition.PriorAcquisitionFunction(model, acquisition_function, decay_beta, prior_floor=1e-12, discretize=False, discrete_bins_factor=10.0, **kwargs)[source]

Bases: smac.optimizer.acquisition.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. (###nolinkyet###) for further details.

update(**kwargs)[source]

Update the acquisition function attributes required for calculation.

Updates the model, the accompanying acquisition function and tracks the iteration number.

Parameters

kwargs (Any) – Additional keyword arguments

Return type

None

class smac.optimizer.acquisition.TS(model, par=0.0)[source]

Bases: smac.optimizer.acquisition.AbstractAcquisitionFunction

Modules

smac.optimizer.acquisition.maximizer