Class NegLogLikelihood
- java.lang.Object
-
- opennlp.tools.ml.maxent.quasinewton.NegLogLikelihood
-
- All Implemented Interfaces:
Function
- Direct Known Subclasses:
ParallelNegLogLikelihood
public class NegLogLikelihood extends Object implements Function
Evaluate negative log-likelihood and its gradient fromDataIndexer
.
-
-
Constructor Summary
Constructors Constructor Description NegLogLikelihood(DataIndexer indexer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDimension()
double[]
getInitialPoint()
double[]
gradientAt(double[] x)
Computes the gradient.double
valueAt(double[] x)
Computes the negative log-likelihood.
-
-
-
Constructor Detail
-
NegLogLikelihood
public NegLogLikelihood(DataIndexer indexer)
- Parameters:
indexer
- TheDataIndexer
to use as input provider.
-
-
Method Detail
-
getDimension
public int getDimension()
- Specified by:
getDimension
in interfaceFunction
- Returns:
- Retrieves the dimension value.
-
getInitialPoint
public double[] getInitialPoint()
- Returns:
- Retrieves the initial point as
double
array.
-
valueAt
public double valueAt(double[] x)
Computes the negative log-likelihood.- Specified by:
valueAt
in 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:
gradientAt
in interfaceFunction
- Parameters:
x
- The input.- Returns:
- Returns the computed gradient.
- Throws:
IllegalArgumentException
- Thrown if parameters were invalid.
-
-