ExactNewtonOptimizer
core/OPT/ExactNewtonOptimizer.h Extends: IterativeOptimizer
Template class to optimize a given TwiceDifferentiableScalarField over using the Newton's iterative optimization method: where denotes the Hessian matrix of the field evaluated at point .
Note
The implementation of Newton's method provided by this class relies on the exact analytical expression of gradient and hessian of the field. See parent class NewtonOptimizer in case you want to use numerically approximations for these quantities or you have no analytical expressions for them.
Info
At each iteration of the method to avoid the cost of matrix inversion, the quantity is computed by solving the linear system in using eigen's QR decompostion with column-pivoting.
Methods
ExactNewtonOptimizer(double step_, const SVector<N>& x0_, unsigned int maxIteration_,
double tolerance_, const TwiceDifferentiableScalarField<N>& objective_)
Constructor.
Args | Description |
---|---|
double step_ |
The term in the iterative formulation of the Newton's method. |
const SVector<N>& x0_ |
The initial point from which the iterative method is started. |
unsigned int maxIteration_ |
The maximum number of iterations allowed. |
double tolerance_ |
The tolerance on the error of the obtained solution requested from the method. |
TwiceDifferentiableScalarField<N>& objective_ |
The objective function to optimize. |
Applies the optimization method to the objective passed as argument. Returns std::pair<SVector<N>,double>
where the first element is the point in where the minimum is reached while the second one is the actual minimum value reached by the objective.
Info
Default stopping condition: the method stops either if the norm of the gradient of the objective reaches the required tolerance or if such tolerance is not reached before a maxIteration
number of iterations.
Tip
You can control the optimizer by exploiting the IterativeOptimizer interface.
Examples
The following code finds the minimum of function using an exact Newton's method with starting from point .