diff --git a/scripts/libraries/ml/ml/preprocessing.py b/scripts/libraries/ml/ml/preprocessing.py index 012349e7a..5ecafd03a 100644 --- a/scripts/libraries/ml/ml/preprocessing.py +++ b/scripts/libraries/ml/ml/preprocessing.py @@ -93,4 +93,6 @@ class Normalization: fadd = (fadd - np.array(self.mean)) / np.array(self.stdev) fscale = fscale / np.array(self.stdev) - array = (array * fscale) + fadd + # Apply normalization in-place (must be done in two steps for ulab). + array *= fscale + array += fadd