Class Normalizer

java.lang.Object
org.tribuo.math.util.Normalizer
All Implemented Interfaces:
Serializable, VectorNormalizer

public class Normalizer extends Object implements VectorNormalizer, Serializable
Normalizes, but first subtracts the minimum value (to ensure positivity).
See Also:
  • Constructor Details

    • Normalizer

      public Normalizer()
  • Method Details

    • normalize

      public double[] normalize(double[] input)
      Description copied from interface: VectorNormalizer
      Normalizes the input array in some fashion specified by the class.
      Specified by:
      normalize in interface VectorNormalizer
      Parameters:
      input - The input to normalize.
      Returns:
      The normalized array.
    • normalizeInPlace

      public void normalizeInPlace(double[] input)
      Description copied from interface: VectorNormalizer
      In place normalization of the array.

      Note: This default implementation performs a copy by calling the standard normalize method.

      Specified by:
      normalizeInPlace in interface VectorNormalizer
      Parameters:
      input - The input to normalize.
    • exportNormalizer

      public ONNXNode exportNormalizer(ONNXNode input)
      Applies ONNX ReduceMin, Sub, ReduceSum, and Div operations to input.
      Specified by:
      exportNormalizer in interface VectorNormalizer
      Parameters:
      input - The node to be normalized according to this implementation.
      Returns:
      the node representing Div, the final applie operation.