syne_tune.optimizer.schedulers.searchers.bayesopt.sklearn.predictor module

class syne_tune.optimizer.schedulers.searchers.bayesopt.sklearn.predictor.SKLearnPredictor[source]

Bases: object

Base class for predictors generated by scikit-learn based estimators of SKLearnEstimator.

This is only for predictors who return means and stddevs in predict().

predict(X)[source]

Returns signals which are statistics of the predictive distribution at input points inputs.

Parameters:

inputs – Input points, shape (n, d)

Return type:

Tuple[ndarray, ndarray]

Returns:

(means, stds), where predictive means means and predictive stddevs stds have shape (n,)

backward_gradient(input, head_gradients)[source]

Needs to be implemented only if gradient-based local optimization of an acquisition function is supported.

Computes the gradient \(\nabla f(x)\) for an acquisition function \(f(x)\), where \(x\) is a single input point. This is using reverse mode differentiation, the head gradients are passed by the acquisition function. The head gradients are \(\partial_k f\), where \(k\) runs over the statistics returned by predict() for the single input point \(x\). The shape of head gradients is the same as the shape of the statistics.

Parameters:
  • input (ndarray) – Single input point \(x\), shape (d,)

  • head_gradients (Dict[str, ndarray]) – See above

Return type:

ndarray

Returns:

Gradient \(\nabla f(x)\)