Tophat prior
smac.model.gaussian_process.priors.tophat_prior
#
SoftTopHatPrior
#
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
Source code in smac/model/gaussian_process/priors/tophat_prior.py
sample_from_prior
#
Returns n_samples
from the prior. All samples are on a log scale. This method calls
self._sample_from_prior
and applies a log transformation to the obtained values.
Parameters#
n_samples : int The number of samples that will be drawn.
Returns#
samples : np.ndarray
Source code in smac/model/gaussian_process/priors/abstract_prior.py
TophatPrior
#
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
Source code in smac/model/gaussian_process/priors/tophat_prior.py
get_log_probability
#
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#
float The log probability of theta
Source code in smac/model/gaussian_process/priors/abstract_prior.py
sample_from_prior
#
Returns n_samples
from the prior. All samples are on a log scale. This method calls
self._sample_from_prior
and applies a log transformation to the obtained values.
Parameters#
n_samples : int The number of samples that will be drawn.
Returns#
samples : np.ndarray