Class ParallelNegLogLikelihood
java.lang.Object
opennlp.tools.ml.maxent.quasinewton.NegLogLikelihood
opennlp.tools.ml.maxent.quasinewton.ParallelNegLogLikelihood
- All Implemented Interfaces:
Function
Evaluate negative log-likelihood and its gradient in parallel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[]gradientAt(double[] x) Computes the gradient.doublevalueAt(double[] x) Computes the negative log-likelihood.Methods inherited from class opennlp.tools.ml.maxent.quasinewton.NegLogLikelihood
getDimension, getInitialPoint
-
Constructor Details
-
ParallelNegLogLikelihood
- Parameters:
indexer- TheDataIndexerto use as input provider.threads- The number of thread to compute with in parallel. Must be greater than0.- Throws:
IllegalArgumentException- Thrown if parameters were invalid.
-
-
Method Details
-
valueAt
public double valueAt(double[] x) Computes the negative log-likelihood.- Specified by:
valueAtin interfaceFunction- Overrides:
valueAtin classNegLogLikelihood- 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- Overrides:
gradientAtin classNegLogLikelihood- Parameters:
x- The input.- Returns:
- Returns the computed gradient.
- Throws:
IllegalArgumentException- Thrown if parameters were invalid.
-