|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.stanford.nlp.optimization.CGMinimizer
public class 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(DiffFunction function,
double functionTolerance,
double[] initial)
Attempts to find an unconstrained minimum of the objective function starting at initial, within
functionTolerance. |
double[] |
minimize(DiffFunction dfunction,
double functionTolerance,
double[] initial,
int maxIterations)
|
| 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 value| Method Detail |
|---|
public double[] minimize(DiffFunction function,
double functionTolerance,
double[] initial)
Minimizerfunction starting at initial, within
functionTolerance.
minimize in interface Minimizer<DiffFunction>function - the objective functionfunctionTolerance - a double valueinitial - a initial feasible point
public double[] minimize(DiffFunction dfunction,
double functionTolerance,
double[] initial,
int maxIterations)
minimize in interface Minimizer<DiffFunction>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||