Documentation ¶
Index ¶
- func DefaultGamma(x int) int
- func DefaultWeights(x int) []float64
- func HyperoptDefaultGamma(x int) int
- type FuncGamma
- type FuncWeights
- type ParzenEstimator
- type ParzenEstimatorParams
- type Sampler
- type SamplerOption
- func SamplerOptionConsiderEndpoints(considerEndpoints bool) SamplerOption
- func SamplerOptionConsiderMagicClip(considerMagicClip bool) SamplerOption
- func SamplerOptionConsiderPrior(considerPrior bool) SamplerOption
- func SamplerOptionGammaFunc(gamma FuncGamma) SamplerOption
- func SamplerOptionNumberOfEICandidates(n int) SamplerOption
- func SamplerOptionNumberOfStartupTrials(n int) SamplerOption
- func SamplerOptionParzenEstimatorParams(params ParzenEstimatorParams) SamplerOption
- func SamplerOptionPriorWeight(priorWeight float64) SamplerOption
- func SamplerOptionSeed(seed int64) SamplerOption
- func SamplerOptionWeights(weights func(x int) []float64) SamplerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultWeights ¶
DefaultWeights is a default weights function.
func HyperoptDefaultGamma ¶
HyperoptDefaultGamma is a default gamma function of Hyperopt.
Types ¶
type ParzenEstimator ¶
ParzenEstimator is a surrogate model for TPE>
func NewParzenEstimator ¶
func NewParzenEstimator(mus []float64, low, high float64, params ParzenEstimatorParams) *ParzenEstimator
NewParzenEstimator returns the parzen estimator object.
type ParzenEstimatorParams ¶
type ParzenEstimatorParams struct { ConsiderPrior bool ConsiderMagicClip bool ConsiderEndpoints bool Weights FuncWeights PriorWeight float64 // optional }
ParzenEstimatorParams holds the parameters of ParzenEstimator
type Sampler ¶
type Sampler struct {
// contains filtered or unexported fields
}
Sampler returns the next search points by using TPE.
func NewSampler ¶
func NewSampler(opts ...SamplerOption) *Sampler
NewSampler returns the TPE sampler.
type SamplerOption ¶
type SamplerOption func(sampler *Sampler)
SamplerOption is a type of the function to customizing TPE sampler.
func SamplerOptionConsiderEndpoints ¶
func SamplerOptionConsiderEndpoints(considerEndpoints bool) SamplerOption
SamplerOptionConsiderEndpoints take endpoints of domains into account when calculating variances of Gaussians in Parzen estimator. See the original paper for details on the heuristics to calculate the variances.
func SamplerOptionConsiderMagicClip ¶
func SamplerOptionConsiderMagicClip(considerMagicClip bool) SamplerOption
SamplerOptionPriorWeight enable a heuristic to limit the smallest variances of Gaussians used in the Parzen estimator.
func SamplerOptionConsiderPrior ¶
func SamplerOptionConsiderPrior(considerPrior bool) SamplerOption
SamplerOptionConsiderPrior enhance the stability of Parzen estimator by imposing a Gaussian prior when True. The prior is only effective if the sampling distribution is either `UniformDistribution`, `DiscreteUniformDistribution`, `LogUniformDistribution`, or `IntUniformDistribution`.
func SamplerOptionGammaFunc ¶
func SamplerOptionGammaFunc(gamma FuncGamma) SamplerOption
SamplerOptionGammaFunc sets the function that takes the number of finished trials and returns the number of trials to form a density function for samples with low grains.
func SamplerOptionNumberOfEICandidates ¶
func SamplerOptionNumberOfEICandidates(n int) SamplerOption
SamplerOptionNumberOfEICandidates sets the number of EI candidates (default 24).
func SamplerOptionNumberOfStartupTrials ¶
func SamplerOptionNumberOfStartupTrials(n int) SamplerOption
SamplerOptionNumberOfStartupTrials sets the number of start up trials (default 10).
func SamplerOptionParzenEstimatorParams ¶
func SamplerOptionParzenEstimatorParams(params ParzenEstimatorParams) SamplerOption
SamplerOptionParzenEstimatorParams sets the parameter of ParzenEstimator.
func SamplerOptionPriorWeight ¶
func SamplerOptionPriorWeight(priorWeight float64) SamplerOption
SamplerOptionPriorWeight sets the weight of the prior.
func SamplerOptionSeed ¶
func SamplerOptionSeed(seed int64) SamplerOption
SamplerOptionSeed sets seed number.
func SamplerOptionWeights ¶
func SamplerOptionWeights(weights func(x int) []float64) SamplerOption
SamplerOptionWeights sets the function that takes the number of finished trials and returns a weight for them. See `Making a Science of Model Search: Hyperparameter Optimization in Hundreds of Dimensions for Vision Architectures <http://proceedings.mlr.press/v28/bergstra13.pdf>` for more details.