Interface VectorNormalizer

All Superinterfaces:
ProtoSerializable<org.tribuo.math.protos.NormalizerProto>, Serializable
All Known Implementing Classes:
ExpNormalizer, NoopNormalizer, Normalizer, SigmoidNormalizer

public interface VectorNormalizer extends ProtoSerializable<org.tribuo.math.protos.NormalizerProto>, Serializable
A functional interface that generates a normalized version of a double array.
  • Method Details

    • normalize

      double[] normalize(double[] input)
      Normalizes the input array in some fashion specified by the class.
      Parameters:
      input - The input to normalize.
      Returns:
      The normalized array.
    • normalizeInPlace

      default void normalizeInPlace(double[] input)
      In place normalization of the array.

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

      Parameters:
      input - The input to normalize.
    • exportNormalizer

      default ONNXNode exportNormalizer(ONNXNode input)
      Exports this normalizer to ONNX, returning the leaf of the appended graph and writing the nodes needed for normalization into the ONNXContext that input belongs to.

      For compatibility reasons this method has a default implementation, though when called it will throw an IllegalStateException. In a future version this method will not have a default implementation and normalizers will be required to provide ONNX support.

      Parameters:
      input - The node to be normalized according to this implementation.
      Returns:
      The leaf node of the graph of operations added to normalize input.
    • deserialize

      static VectorNormalizer deserialize(org.tribuo.math.protos.NormalizerProto proto)
      Deserializes the vector normalizer from the supplied protobuf.
      Parameters:
      proto - The protobuf to deserialize.
      Returns:
      The normalizer.