ParallelNegLogLikelihood (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.ml.maxent.quasinewton

## Class ParallelNegLogLikelihood

- java.lang.Object
- - opennlp.tools.ml.maxent.quasinewton.NegLogLikelihood
  - - opennlp.tools.ml.maxent.quasinewton.ParallelNegLogLikelihood

- All Implemented Interfaces:
    Function

      public class ParallelNegLogLikelihood
      extends NegLogLikelihood

  Evaluate negative log-likelihood and its gradient in parallel

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ParallelNegLogLikelihood(DataIndexer indexer, int threads)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double[]` | `gradientAt(double[] x)` Compute gradient
    `double` | `valueAt(double[] x)` Negative log-likelihood

    - ### Methods inherited from class opennlp.tools.ml.maxent.quasinewton.NegLogLikelihood

      `getDimension, getInitialPoint`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ParallelNegLogLikelihood

          public ParallelNegLogLikelihood(DataIndexer indexer,
                                          int threads)

  - ### Method Detail

    - #### valueAt

          public double valueAt(double[] x)

      Negative log-likelihood
      Specified by:
        `valueAt` in interface `Function`
      Overrides:
        `valueAt` in class `NegLogLikelihood`

    - #### gradientAt

          public double[] gradientAt(double[] x)

      Compute gradient
      Specified by:
        `gradientAt` in interface `Function`
      Overrides:
        `gradientAt` in class `NegLogLikelihood`

Copyright © 2026 The Apache Software Foundation. All rights reserved.