smac.model.gaussian_process.priors.tophat_prior

Classes

SoftTopHatPrior(lower_bound, upper_bound, ...)

Soft Tophat prior as it used in the original spearmint code.

TophatPrior(lower_bound, upper_bound[, seed])

Tophat prior as it used in the original spearmint code.

Interfaces

class smac.model.gaussian_process.priors.tophat_prior.SoftTopHatPrior(lower_bound, upper_bound, exponent, seed=0)[source]

Bases: AbstractPrior

Soft Tophat prior as it used in the original spearmint code.

Parameters:
  • lower_bound (float) – Lower bound of the prior. In original scale.

  • upper_bound (float) – Upper bound of the prior. In original scale.

  • exponent (float) – Exponent of the prior.

  • seed (int, defaults to 0) –

get_gradient(theta)[source]

Computes the gradient of the prior with respect to theta. Internally, his method calls self._get_gradient.

Warning

Theta must be on the original scale.

Parameters:

theta (float) – Hyperparameter configuration in log space

Returns:

gradient – The gradient of the prior at theta.

Return type:

float

get_log_probability(theta)[source]

Returns the log probability of theta. This method exponentiates theta and calls self._get_log_probability.

Warning

Theta must be on a log scale!

Parameters:

theta (float) – Hyperparameter configuration in log space.

Returns:

The log probability of theta

Return type:

float

property meta: dict[str, Any]

Returns the meta data of the created object.

class smac.model.gaussian_process.priors.tophat_prior.TophatPrior(lower_bound, upper_bound, seed=0)[source]

Bases: AbstractPrior

Tophat prior as it used in the original spearmint code.

Parameters:
  • lower_bound (float) – Lower bound of the prior. In original scale.

  • upper_bound (float) – Upper bound of the prior. In original scale.

  • seed (int, defaults to 0) –

get_gradient(theta)[source]

Computes the gradient of the prior with respect to theta. Internally, his method calls self._get_gradient.

Warning

Theta must be on the original scale.

Parameters:

theta (float) – Hyperparameter configuration in log space

Returns:

gradient – The gradient of the prior at theta.

Return type:

float

property meta: dict[str, Any]

Returns the meta data of the created object.