Expand description
Here are traits that are used in optimization algorithms. They are defined here to avoid circular dependencies between the optimization algorithms and the traits they use.
See the book entry Optimisation.
Structs§
- Optimization
Result OptimizationResult: the best parameters found, the objective there, the iterations taken and whether the method’s convergence test was met. What counts as an iteration, and what the test is, differ between methods; see each method’s documentation.
Traits§
- Gradient
Based Minimization Engine - Gradient Based Minimization Engine trait that extends the MinimizationControls trait and has a method
gradient_based_minimizethat takes an objective function, an initial guess for the parameters, and returns the parameters that minimize the objective function.
This trait is intended for optimization algorithms that require the use of gradients, such as gradient descent or Newton’s method. The method takes an additional argument for the gradient function, which is used to compute the gradient of the objective function at the current parameters. The optimization algorithm can then use this gradient information to update the parameters in the direction of steepest descent, or to compute a search direction for more advanced optimization methods. - Gradient
Free Minimization Engine - Gradient Free Minimization Engine trait that extends the MinimizationControls trait and has a method
gradient_free_minimizethat takes an objective function and an initial guess for the parameters, and returns the parameters that minimize the objective function. - Gradient
Function GradientFunction: A trait for gradient functions that can be used in optimization algorithms. It has a methodevaluatethat takes a vector of parameters and returns a vector of the same length representing the gradient of the objective function at those parameters.- Hessian
Based Minimization Engine - Hessian Based Minimization Engine trait that extends the MinimizationControls trait and has a method
hessian_based_minimizethat takes an objective function, an initial guess for the parameters, and returns the parameters that minimize the objective function. This trait is intended for optimization algorithms that require the use of second-order information, such as Newton’s method or quasi-Newton methods. The method takes additional arguments for the gradient function and the Hessian function, which are used to compute the gradient and Hessian of the objective function at the current parameters. The optimization algorithm can then use this information to update the parameters in a more informed way, potentially leading to faster convergence to the minimum. - Hessian
Function HessianFunction: the Hessian∂²f/∂xᵢ∂xⱼof the objective at the given parameters, as rows of a symmetric matrix. Used byNewtonRaphsonMethod.- Minimization
Controls - ‘MinimizationControls’: A trait that defines methods for setting and getting the convergence criteria for optimization algorithms, including maximum iterations, tolerance, and optional bounds for the optimization.
- Objective
Function ObjectiveFunction: A trait for objective functions that can be optimized. It has a methodevaluatethat takes a vector of parameters and returns a single scalar value of the objective function at those parameters.- Objective
Function With Gradient ObjectiveFunctionWithGradient: A trait for objective functions that also have a gradient. It is a marker trait that indicates that the objective function implements bothObjectiveFunctionandGradientFunction.