Class LineSearchFletcher86
- java.lang.Object
-
- org.ddogleg.optimization.impl.LineSearchFletcher86
-
- All Implemented Interfaces:
- java.io.Serializable, IterativeOptimization, LineSearch
public class LineSearchFletcher86 extends java.lang.Object implements LineSearch
Line search which meets the strong Wolfe line condition. The Wolfe condition stipulates that αk (the step size) should give sufficient decrease in the objective function below. The two parameters 0
<ftol ≤ gtol<1 determine how stringent the search is. For a full description of optimization parameters see [1].Wolfe condition
φ(α) ≤ φ(0) + ftol*α*φ'(0)
| φ'(α)| ≤ gtol*|φ'(0)|
where φ is the objective function and φ' is its derivative.A typical application of using this line search is to find the minimum of an 'N' dimensional function along a line with slope 'p'. In which case φ(α) is defined below:
φ(αk) = f(xk + αk*pk)[1] R. Fletcher, "Practical Methods of Optimization" 2nd Ed. 1986
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description LineSearchFletcher86(double ftol, double gtol, double fmin, double t1, double t2, double t3)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetFunction()Function value at the current stepdoublegetStep()Returns the current approximate solution for the line searchjava.lang.StringgetWarning()Provides feed back if something went wrong, but still produced a solution.voidinit(double funcAtZero, double derivAtZero, double funcAtInit, double initAlpha, double stepMin, double stepMax)Initializes and resets the line search.booleanisConverged()Indicates if iteration stopped due to convergence or not.booleanisUpdated()True if the parameter(s) being optimized have been updatedbooleaniterate()Updates the search.voidsetFunction(CoupledDerivative function)Sets the function being optimized.
-
-
-
Constructor Detail
-
LineSearchFletcher86
public LineSearchFletcher86(double ftol, double gtol, double fmin, double t1, double t2, double t3)- Parameters:
ftol- Controls required reduction in value. Try 1e-4gtol- Controls decrease in derivative magnitude. Try 0.9fmin- Minimum acceptable value of f(x). zero for least squares.t1- Prevents alpha from growing too large during bracket phase. Try 9t2- Prevents alpha from being too close to bounds during sectioning. Recommend t2<c2. Try 0.1t3- Prevents alpha from being too close to bounds during sectioning. Try 0.5
-
-
Method Detail
-
setFunction
public void setFunction(CoupledDerivative function)
Sets the function being optimized.- Specified by:
setFunctionin interfaceLineSearch- Parameters:
function- Line search function and derivative
-
init
public void init(double funcAtZero, double derivAtZero, double funcAtInit, double initAlpha, double stepMin, double stepMax)Description copied from interface:LineSearchInitializes and resets the line search. In some implementations a reasonable minimum and maximum step bound is set here.- Specified by:
initin interfaceLineSearch- Parameters:
funcAtZero- Value of f(0)derivAtZero- Derivative of at f(0)funcAtInit- Value of f at initial value of step: f(step)initAlpha- Initial step sizestepMin- Minimum allowed step.stepMax- Maximum allowed step.
-
iterate
public boolean iterate()
Updates the search. If the search has terminated true is returned. After the search has terminated invoke
IterativeOptimization.isConverged()to see if a solution has been converged to or if it stopped for some other reason.NOTE: The optimization parameters might not be modified after iterate() is called. An internal book keeping step might have been done. To see if parameters have changed call
IterativeOptimization.isUpdated().- Specified by:
iteratein interfaceIterativeOptimization- Returns:
- true if it has converged or that no more progress can be made.
-
getStep
public double getStep()
Description copied from interface:LineSearchReturns the current approximate solution for the line search- Specified by:
getStepin interfaceLineSearch- Returns:
- current solution
-
getWarning
public java.lang.String getWarning()
Description copied from interface:IterativeOptimizationProvides feed back if something went wrong, but still produced a solution. If there is no message then null is returned. The meaning and type of messages are implementation specific.- Specified by:
getWarningin interfaceIterativeOptimization- Returns:
- Additional info on the computed solution.
-
isConverged
public boolean isConverged()
Description copied from interface:IterativeOptimizationIndicates if iteration stopped due to convergence or not.- Specified by:
isConvergedin interfaceIterativeOptimization- Returns:
- True if iteration stopped because it converged.
-
getFunction
public double getFunction()
Description copied from interface:LineSearchFunction value at the current step- Specified by:
getFunctionin interfaceLineSearch
-
isUpdated
public boolean isUpdated()
Description copied from interface:IterativeOptimizationTrue if the parameter(s) being optimized have been updated- Specified by:
isUpdatedin interfaceIterativeOptimization- Returns:
- True if parameters have been updated
-
-
DataMelt 3.0 © DataMelt by jWork.ORG