QNMinimizer.L2RegFunction (Apache OpenNLP Tools 2.5.9 API)
Description: declaration: package: opennlp.tools.ml.maxent.quasinewton, class: QNMinimizer, class: L2RegFunction

# 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
  Description
  `L2RegFunction(Function f, double l2Cost)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getDimension()`
  `double[]`
  `gradientAt(double[] x)`
  Computes the gradient for `x`.
  `double`
  `valueAt(double[] x)`
  Computes the function value for `x`.

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### L2RegFunction

    public L2RegFunction(Function f, double l2Cost)

- ## Method Details

  - ### getDimension

    public int getDimension()
    Specified by:
      `getDimension` in interface `Function`
    Returns:
      Retrieves the dimension value.

  - ### valueAt

    public double valueAt(double[] x)
    Description copied from interface: `Function`
    Computes the function value for `x`.
    Specified by:
      `valueAt` in interface `Function`
    Parameters:
      `x` - The input vector.
    Returns:
      Returns the computed value for `x`.

  - ### gradientAt

    public double[] gradientAt(double[] x)
    Description copied from interface: `Function`
    Computes the gradient for `x`.
    Specified by:
      `gradientAt` in interface `Function`
    Parameters:
      `x` - The input vector.
    Returns:
      Returns the computed gradient for `x`.