Package org.ddogleg.optimization
Interface LineSearch
- All Superinterfaces:
IterativeOptimization
,Serializable
- All Known Implementing Classes:
LineSearchFletcher86
,LineSearchMore94
Line search for nonlinear optimization. Computes function values at different step lengths. all step lengths must be greater than or equal to zero. The derivative at step zero must be less than zero.
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Function value at the current stepdouble
getGTol()
from wolfe condition.double
getStep()
Returns the current approximate solution for the line searchvoid
init
(double funcAtZero, double derivAtZero, double funcAtInit, double stepInit, double stepMin, double stepMax) Initializes and resets the line search.void
setConvergence
(double ftol, double gtol) Specify convergence criteria for line searchvoid
setFunction
(CoupledDerivative function, double fmin) Sets the function being optimized.Methods inherited from interface org.ddogleg.optimization.IterativeOptimization
isConverged, isUpdated, iterate, setVerbose
-
Method Details
-
setFunction
Sets the function being optimized.- Parameters:
function
- Line search function and derivativefmin
- Minimum possible function value
-
setConvergence
void setConvergence(double ftol, double gtol) Specify convergence criteria for line search- Parameters:
ftol
- Tolerance for sufficient decrease. ftol>
0. Smaller value for loose tolerance. Try 1e-4gtol
- Tolerance for curvature condition. gtol ≥ 0. Larger value for loose tolerance. Try 0.9
-
init
void init(double funcAtZero, double derivAtZero, double funcAtInit, double stepInit, double stepMin, double stepMax) Initializes and resets the line search. In some implementations a reasonable minimum and maximum step bound is set here.- Parameters:
funcAtZero
- Value of f(0)derivAtZero
- Derivative of at f(0)funcAtInit
- Value of f at initial value of step: f(step)stepInit
- Initial step sizestepMin
- Minimum allowed step.stepMax
- Maximum allowed step.
-
getStep
double getStep()Returns the current approximate solution for the line search- Returns:
- current solution
-
getFunction
double getFunction()Function value at the current step -
getGTol
double getGTol()from wolfe condition. Used to estimate max line search step
-