|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.stanford.nlp.optimization.AbstractCachingDiffFunction
public abstract class AbstractCachingDiffFunction
A differentiable function that caches the last evaluation of its value and derivative.
| Field Summary | |
|---|---|
protected double[] |
derivative
|
protected double |
value
|
| Constructor Summary | |
|---|---|
AbstractCachingDiffFunction()
|
|
| Method Summary | |
|---|---|
protected abstract void |
calculate(double[] x)
Calculate the value at x and the derivative and save them in the respective fields. |
protected void |
clearCache()
Clears the cache in a way that doesn't require reallocation :-) |
protected static void |
copy(double[] copy,
double[] orig)
|
double[] |
derivativeAt(double[] x)
Returns the first-derivative vector at the input location. |
boolean |
gradientCheck()
|
double[] |
initial()
Returns the intitial point in the domain (but not necessarily a feasible one). |
double |
lastValue()
|
double[] |
randomInitial()
|
double |
valueAt(double[] x)
Returns the value of the function at a single point. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface edu.stanford.nlp.optimization.Function |
|---|
domainDimension |
| Field Detail |
|---|
protected double[] derivative
protected double value
| Constructor Detail |
|---|
public AbstractCachingDiffFunction()
| Method Detail |
|---|
public boolean gradientCheck()
protected abstract void calculate(double[] x)
x - The point at which to calculate the functionprotected void clearCache()
public double[] initial()
HasInitial
initial in interface HasInitialpublic double[] randomInitial()
protected static void copy(double[] copy,
double[] orig)
public double valueAt(double[] x)
Function
valueAt in interface Functionx - a double[] input
public double[] derivativeAt(double[] x)
DiffFunction
derivativeAt in interface DiffFunctionx - a double[] input vector
public double lastValue()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||