|
NuriKit v0.1.0b2
|
BFGS minimizer. More...
#include <nuri/algo/optim.h>
Public Member Functions | |
| Bfgs (MutRef< ArrayXd > x) | |
| Prepare BFGS minimization algorithm. | |
| template<class FuncGrad> | |
| BfgsResult | minimize (FuncGrad fg, const double pgtol=1e-5, const double xrtol=0, int maxiter=-1, const int maxls=100, const double ftol=1e-4, const double gtol=0.9, const double xtol=1e-14) |
| Minimize a function using BFGS algorithm. | |
BFGS minimizer.
References:
This implementation is based on the Python implementation of BFGS in the SciPy library, with optimized Hessian update step suggested by the linked Wikipedia page. The original implementation is released under the BSD 3-Clause License (included below).
| nuri::Bfgs::Bfgs | ( | MutRef< ArrayXd > | x | ) |
Prepare BFGS minimization algorithm.
| x | Initial guess. Will be modified in-place. |
|
inline |
Minimize a function using BFGS algorithm.
| FuncGrad | Function object that computes the function value and gradient. Function value should be returned and gradient should be updated in the input gradient vector. |
| fg | Function object. |
| pgtol | Stop when the projected gradient is less than this value. |
| xrtol | Stop when the relative change in x is less than this value. |
| maxiter | Maximum number of iterations. If negative, it will be set to 200 times the number of variables. |
| maxls | Maximum number of line search steps. |
| ftol | Tolerance for the relative change in the function value. |
| gtol | Gradient tolerance for the line search step. |
| xtol | Tolerance for the relative change in x. |