Skip to main content

Module optimization_traits

Module optimization_traits 

Source
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§

OptimizationResult
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§

GradientBasedMinimizationEngine
Gradient Based Minimization Engine trait that extends the MinimizationControls trait and has a method gradient_based_minimize that 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.
GradientFreeMinimizationEngine
Gradient Free Minimization Engine trait that extends the MinimizationControls trait and has a method gradient_free_minimize that takes an objective function and an initial guess for the parameters, and returns the parameters that minimize the objective function.
GradientFunction
GradientFunction: A trait for gradient functions that can be used in optimization algorithms. It has a method evaluate that takes a vector of parameters and returns a vector of the same length representing the gradient of the objective function at those parameters.
HessianBasedMinimizationEngine
Hessian Based Minimization Engine trait that extends the MinimizationControls trait and has a method hessian_based_minimize that 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.
HessianFunction
HessianFunction: the Hessian ∂²f/∂xᵢ∂xⱼ of the objective at the given parameters, as rows of a symmetric matrix. Used by NewtonRaphsonMethod.
MinimizationControls
‘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.
ObjectiveFunction
ObjectiveFunction: A trait for objective functions that can be optimized. It has a method evaluate that takes a vector of parameters and returns a single scalar value of the objective function at those parameters.
ObjectiveFunctionWithGradient
ObjectiveFunctionWithGradient: A trait for objective functions that also have a gradient. It is a marker trait that indicates that the objective function implements both ObjectiveFunction and GradientFunction.