QNMinimizer.L2RegFunction (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.ml.maxent.quasinewton

## Class QNMinimizer.L2RegFunction

- java.lang.Object
- - opennlp.tools.ml.maxent.quasinewton.QNMinimizer.L2RegFunction

- All Implemented Interfaces:
    Function
  Enclosing class:
    QNMinimizer

      public static class QNMinimizer.L2RegFunction
      extends Object
      implements Function

  L2-regularized objective function

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `L2RegFunction(Function f, double l2Cost)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getDimension()`
    `double[]` | `gradientAt(double[] x)`
    `double` | `valueAt(double[] x)`

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

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

- - ### Constructor Detail

    - #### L2RegFunction

          public L2RegFunction(Function f,
                               double l2Cost)

  - ### Method Detail

    - #### getDimension

          public int getDimension()

      Specified by:
        `getDimension` in interface `Function`

    - #### valueAt

          public double valueAt(double[] x)

      Specified by:
        `valueAt` in interface `Function`

    - #### gradientAt

          public double[] gradientAt(double[] x)

      Specified by:
        `gradientAt` in interface `Function`

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