Interface VectorNormalizer
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ExpNormalizer,NoopNormalizer,Normalizer,SigmoidNormalizer
A functional interface that generates a normalized version of a double array.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ONNXNodeexportNormalizer(ONNXNode input) Exports this normalizer to ONNX, returning the leaf of the appended graph and writing the nodes needed for normalization into theONNXContextthatinputbelongs to.double[]normalize(double[] input) Normalizes the input array in some fashion specified by the class.default voidnormalizeInPlace(double[] input) In place normalization of the 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
Exports this normalizer to ONNX, returning the leaf of the appended graph and writing the nodes needed for normalization into theONNXContextthatinputbelongs 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.
-