Package org.tribuo.math.util
Class ExpNormalizer
java.lang.Object
org.tribuo.math.util.ExpNormalizer
- All Implemented Interfaces:
Serializable
,VectorNormalizer
Normalizes the exponential values of the input array. Used when the input is in log space.
a.k.a. SoftMax.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionexportNormalizer
(ONNXNode input) Returns the ONNX softmax node over the 2nd dimension.double[]
normalize
(double[] input) Normalizes the input array in some fashion specified by the class.void
normalizeInPlace
(double[] input) In place normalization of the array.
-
Constructor Details
-
ExpNormalizer
public ExpNormalizer()
-
-
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 interfaceVectorNormalizer
- 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 interfaceVectorNormalizer
- Parameters:
input
- The input to normalize.
-
exportNormalizer
Returns the ONNX softmax node over the 2nd dimension.- Specified by:
exportNormalizer
in interfaceVectorNormalizer
- Parameters:
input
- The node to be normalized according to this implementation.- Returns:
- ONNX softmax node of input.
-