|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.stanford.nlp.optimization.CGMinimizer
Conjugate-gradient implementation based on the code in Numerical Recipes in C. (See p. 423 and others.) As of now, it requires a differentiable function (DiffFunction) as input. Equality constraints are supported; inequality constraints may soon be added. The basic way to use the minimizer is with a null constructor, then the simple minimize method:
Minimizer cgm = new CGMinimizer();
DiffFunction df = new SomeDiffFunction();
double tol = 1e-4;
double[] initial = getInitialGuess();
double[] minimum = cgm.minimize(df,tol,initial);
Constructor Summary | |
CGMinimizer()
Basic constructor, use this. |
|
CGMinimizer(boolean silent)
Pass in false to get per-iteration progress reports
(to stderr). |
|
CGMinimizer(Function monitor)
Perform minimization with monitoring. |
Method Summary | |
double[] |
minimize(Function function,
double functionTolerance,
double[] initial)
Attempts to find an unconstrained minimum of the objective function starting at initial , within
functionTolerance . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CGMinimizer()
public CGMinimizer(boolean silent)
false
to get per-iteration progress reports
(to stderr).
silent
- a boolean
valuepublic CGMinimizer(Function monitor)
x
being that iteration's ending point. A return <
tol
forces convergence (terminates the CG procedure).
Specially for Kristina.
monitor
- a Function
valueMethod Detail |
public double[] minimize(Function function, double functionTolerance, double[] initial)
Minimizer
function
starting at initial
, within
functionTolerance
.
minimize
in interface Minimizer
function
- the objective functionfunctionTolerance
- a double
valueinitial
- a initial feasible point
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |