Documentation
¶
Overview ¶
Package optimization helps to find better configuration of your service or library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidParameterCombination = errors.New("invalid parameter combination")
ErrInvalidParameterCombination notifies optimizer about invalid combination of parameters. CostFunction must return MaxCost and ErrInvalidParameterCombination if it happened.
Functions ¶
This section is empty.
Types ¶
type ConfigModifier ¶
type ConfigModifier func(int)
ConfigModifier injects parameter value received from the optimizer into configuration instance.
type CostFunction ¶
CostFunction (or objective function) is implemented by clients. Optimizer will try to find the best possible combination of your parameters on the basis of this function. CostFunction call is expected to be expensive, so client should check context expiration.
type InitStrategy ¶ added in v0.4.0
type InitStrategy int8
InitStrategy determines the way RBFOpt selects points.
const ( LHDMaximin InitStrategy = iota LHDCorr AllCorners LowerCorners RandCorners )
func (InitStrategy) MarshalJSON ¶ added in v0.4.0
func (s InitStrategy) MarshalJSON() ([]byte, error)
MarshalJSON renders InitStrategy to JSON.
type ParameterDescription ¶
type ParameterDescription struct { Bound *Bound `json:"bound"` ConfigModifier ConfigModifier `json:"-"` Name string `json:"name"` }
ParameterDescription is something you want to optimization in your service configuration.
type ParameterValue ¶
ParameterValue describes some value of a CostFunction argument.
type Report ¶
type Report struct { Cost Cost `json:"cost"` // Discovered optimal value of a CostFunction Optimum []*ParameterValue `json:"optimum"` // Parameter values matching the optimum point Iterations int `json:"iterations"` Evaluations int `json:"evaluations"` FastEvaluations int `json:"fast_evaluations"` }
Report contains information about the finished optimization process
type Settings ¶
type Settings struct { // RootDir - place to store reports and other things // (optimizer will create it if it doesn't exist). RootDir string // CostFunction itself CostFunction CostFunction // Arguments of a CostFunctions Parameters []*ParameterDescription // RBFOpt: limits number of evaluations MaxEvaluations uint // RBFOpt: limits number of iterations MaxIterations uint // RBFOpt: reason: https://github.com/coin-or/rbfopt/issues/28 InvalidParameterCombinationCost Cost // Set to true if you don't want to see large values corresponding to the ErrInvalidParametersCombination on your plots SkipInvalidParameterCombinationOnPlots bool // Strategy to select initial points. InitStrategy InitStrategy }
Settings contains the description of what and how to optimize.