Class NegLogLikelihood
java.lang.Object
opennlp.tools.ml.maxent.quasinewton.NegLogLikelihood
- All Implemented Interfaces:
Function
- Direct Known Subclasses:
ParallelNegLogLikelihood
Evaluates negative log-likelihood and its gradient from
DataIndexer.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdouble[]double[]gradientAt(double[] x) Computes the gradient.doublevalueAt(double[] x) Computes the negative log-likelihood.
-
Constructor Details
-
NegLogLikelihood
- Parameters:
indexer- TheDataIndexerto use as input provider.
-
-
Method Details
-
getDimension
public int getDimension()- Specified by:
getDimensionin interfaceFunction- Returns:
- Retrieves the dimension value.
-
getInitialPoint
public double[] getInitialPoint()- Returns:
- Retrieves the initial point as
doublearray.
-
valueAt
public double valueAt(double[] x) Computes the negative log-likelihood.- Specified by:
valueAtin interfaceFunction- Parameters:
x- The input.- Returns:
- Returns the computed negative log-likelihood.
- Throws:
IllegalArgumentException- Thrown if parameters were invalid.
-
gradientAt
public double[] gradientAt(double[] x) Computes the gradient.- Specified by:
gradientAtin interfaceFunction- Parameters:
x- The input.- Returns:
- Returns the computed gradient.
- Throws:
IllegalArgumentException- Thrown if parameters were invalid.
-