|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.omegahat.Numerics.Optimizers.LineSearchBasic
|
+--org.omegahat.Numerics.Optimizers.LineSearchWolfe
a line search algorithm that finds a point with good enough improvement and slope.
Specifically, the point satisfies the ``strong Wolfe'' conditions: the new
value at the new point must lie below a line drawn from the original point with chosen
slope, and the slope at the new point in the chosen direction must be
shallow enough to accept the point as an approximate minimum. Slopes are expressed as fractions of the slope at the
original point in the chosen direction (i.e., of the inner product of
the gradient and the direction at the original point). The two
thresholds are valueTol and slopeTol.
See, e.g., Nocedal and Wright, ``Numerical Optimization'', section
3.1.
These conditions support some convergence theory for descent direction
methods, particularly for quasi-Newton methods.
| Field Summary | |
protected double |
expansionFactor
The expansion factor allowed on initial expansion steps (default 4.). |
protected LineStep |
high
The current upper bound for the optimum. |
protected boolean |
interpolatingStage
|
protected LineStep |
low
the current lower bound for the optimium. |
protected double |
maxStep
The maximum step length to be taken, as a multiple of the initial step. |
protected LineStep |
prev
the previous step taken in the search. |
protected double |
slopeTol
Tolerance for the slope, default 0.9 |
protected double |
valueTol
The tolerance for the function value, default 1.e-4. |
| Fields inherited from class org.omegahat.Numerics.Optimizers.LineSearchBasic |
debug, direction, evaluations, maxEvaluations, origin, state, stepMax, stepMin |
| Fields inherited from interface org.omegahat.Numerics.Optimizers.LineSearch |
CONTINUE, EXCEPTION, SUCCESSFUL, TOO_LARGE, TOO_MANY, TOO_NARROW, TOO_SMALL |
| Constructor Summary | |
LineSearchWolfe()
Create an empty object. |
|
LineSearchWolfe(ModelPointNumericInt p)
Create the line search object and initialize its internal data to correspond to the model point. |
|
| Method Summary | |
boolean |
continueIteration(LineStep step)
Tests whether the search should continue. |
LineStep |
emergency(LineStep step,
java.lang.Error e)
An emergency operation, taken when an evaluation generates an error. |
protected double |
extrapolateStep(LineStep step)
|
double |
getExpansionFactor()
Accessor for expansionFactor field |
LineStep |
getHigh()
Accessor for high field |
boolean |
getInterpolatingStage()
Accessor for interpolatingStage field |
LineStep |
getLow()
Accessor for low field |
double |
getMaxStep()
Accessor for maxStep field |
LineStep |
getPrev()
Accessor for prev field |
double |
getSlopeTol()
Accessor for slopeTol field |
double |
getValueTol()
Accessor for valueTol field |
LineStep |
initialize(ModelPointNumericInt theta,
NumericArray p,
double step)
Initialize the search object, typically with a new direction from the current estimate. |
protected boolean |
interpolates(double x,
double xl,
double xh)
|
protected double |
interpolateStep(LineStep step)
|
void |
make(ModelPointNumericInt p)
create the internal model points to correspond to the data in p. |
protected static double |
maxAbs(double a,
double b,
double c)
|
LineStep |
refineStep(LineStep step)
Evaluate a proposed step, and return the proposed next step. |
double |
setExpansionFactor(double value)
Accessor for setting expansionFactor field |
protected LineStep |
setHigh(LineStep value)
Accessor for setting high field |
boolean |
setInterpolatingStage(boolean value)
Accessor for setting interpolatingStage field |
protected LineStep |
setLow(LineStep value)
Accessor for setting low field |
double |
setMaxStep(double value)
Accessor for setting maxStep field |
protected LineStep |
setPrev(LineStep value)
Accessor for setting prev field |
double |
setSlopeTol(double value)
Accessor for setting slopeTol field |
double |
setValueTol(double value)
Accessor for setting valueTol field |
boolean |
testForInterpolation(LineStep step)
Test this step for a valid interpolation, so the algorithm can switch into its interpolating stage. |
| Methods inherited from class org.omegahat.Numerics.Optimizers.LineSearchBasic |
getDebug, getDirection, getEvaluations, getMaxEvaluations, getOrigin, getState, getStepMax, getStepMin, incrementCount, setDebug, setDirection, setEvaluations, setMaxEvaluations, setOrigin, setState, setStepMax, setStepMin |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected double valueTol
protected double slopeTol
protected double expansionFactor
protected double maxStep
The default is 1e20, but how big the bound should be is a difficult question to answer in general. The nasty cases are that the initial step estimate is very much too small or that the function has no lower bound in this direction. In the latter case you are sunk, since the model you posed has no (global) minimum.
protected LineStep prev
protected LineStep low
protected LineStep high
protected boolean interpolatingStage
| Constructor Detail |
public LineSearchWolfe(ModelPointNumericInt p)
public LineSearchWolfe()
| Method Detail |
public double getValueTol()
valueTol fieldpublic double setValueTol(double value)
valueTol fieldpublic double getSlopeTol()
slopeTol fieldpublic double setSlopeTol(double value)
slopeTol fieldpublic double getExpansionFactor()
expansionFactor fieldpublic double setExpansionFactor(double value)
expansionFactor fieldpublic double getMaxStep()
maxStep fieldpublic double setMaxStep(double value)
maxStep fieldpublic LineStep getPrev()
prev fieldprotected LineStep setPrev(LineStep value)
prev fieldpublic LineStep getLow()
low fieldprotected LineStep setLow(LineStep value)
low fieldpublic LineStep getHigh()
high fieldprotected LineStep setHigh(LineStep value)
high fieldpublic boolean getInterpolatingStage()
interpolatingStage fieldpublic boolean setInterpolatingStage(boolean value)
interpolatingStage fieldpublic LineStep refineStep(LineStep step)
The convergence field of the step object may be set either by the
continueIteration method or by the methods that extrapolate or interpolate (if the
proposed new step would violate the constraints on the search).
protected double extrapolateStep(LineStep step)
protected double interpolateStep(LineStep step)
protected static double maxAbs(double a,
double b,
double c)
protected boolean interpolates(double x,
double xl,
double xh)
public boolean testForInterpolation(LineStep step)
public boolean continueIteration(LineStep step)
SUCCESSFUL in case of numeric convergence by the
criterion of the search, or any of a number of states indicating failure.continueIteration in class LineSearchBasic
public LineStep initialize(ModelPointNumericInt theta,
NumericArray p,
double step)
If theta is an evaluated model point, it is taken
to be the previous step, for computing the interpolations, etc.
The interpolatingStage flag is set to false.
initialize in class LineSearchBasic
public LineStep emergency(LineStep step,
java.lang.Error e)
NOT IMPLEMENTED YET!
What happens depends on the stage. In the extrapolation stage, we know that we have taken getEvaluations() expansion steps, so the current step is expansionFactor^(getEvaluations()-1) times the initial step. The previous step succeeded, so we can move back towards that step, searching for a successful point.
An exception in the interpolation phase is more troubling, since it implies a discontinuity in the function in the interval of interpolation. Chances of anything succeeding in this case are not good, but we basically try some alternative interpolations in hopes of hitting a valid interval.
public void make(ModelPointNumericInt p)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||