smac.model.gaussian_process.priors¶
Interfaces¶
- class smac.model.gaussian_process.priors.GammaPrior(a, scale, loc, seed=0)[source]¶
Bases:
AbstractPrior
Implementation of gamma prior.
f(x) = (x-loc)**(a-1) * e**(-(x-loc)) * (1/scale)**a / gamma(a)
- Parameters:
a (float) – The shape parameter. Must be greater than 0.
scale (float) – The scale parameter (1/scale corresponds to parameter p in canonical form). Must be greather than 0.
loc (float) – Mean parameter for the distribution.
seed (int, defaults to 0)
- property meta: dict[str, Any]¶
Returns the meta data of the created object.
- class smac.model.gaussian_process.priors.HorseshoePrior(scale, seed=0)[source]¶
Bases:
AbstractPrior
Horseshoe Prior as it is used in spearmint.
- Parameters:
scale (float) – Scaling parameter.
seed (int, defaults to 0)
- property meta: dict[str, Any]¶
Returns the meta data of the created object.
- class smac.model.gaussian_process.priors.LogNormalPrior(sigma, mean=0, seed=0)[source]¶
Bases:
AbstractPrior
Implements the log normal prior.
- Parameters:
sigma (float) – Specifies the standard deviation of the normal distribution.
mean (float) – Specifies the mean of the normal distribution.
seed (int, defaults to 0)
- property meta: dict[str, Any]¶
Returns the meta data of the created object.
- class smac.model.gaussian_process.priors.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.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.