MatX
MatX copied to clipboard
[FEA] Add Normalize function
Is your feature request related to a problem? Please describe. add the ability to normalize all values in a tensor to some range, equivalent to MATLAB's implementation
Describe the solution you'd like
auto A = [0, 1 , 2, 3, 4 , 5 ]
auto normA = matx::normalize(A, matx::NORMALIZE_RANGE);
normA = [0, 0.2, 0.4, 0.6, 0.8, 1]
matlab equivalent:
>> A = [0, 1, 2, 3, 4, 5]
A =
0 1 2 3 4 5
>> aNorm = normalize(A, "range")
aNorm =
0 0.2000 0.4000 0.6000 0.8000 1.0000
Describe alternatives you've considered This is trivial to implement by-hand today, but is a common-enough process that we should have an API for it. we could also better optimize for the various normalize methods described by the matlab implementations.