From 714ad858aa5df0851b72e40b5af2e53ccc347f47 Mon Sep 17 00:00:00 2001 From: Neil Lawrence Date: Wed, 19 May 2021 18:31:52 +0100 Subject: [PATCH] Update GPy/util/normalizer.py --- GPy/util/normalizer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GPy/util/normalizer.py b/GPy/util/normalizer.py index 243f81c7..d04e7324 100644 --- a/GPy/util/normalizer.py +++ b/GPy/util/normalizer.py @@ -92,7 +92,8 @@ class Standardize(_Norm): self.std = Y.std(0).view(np.ndarray) if np.any(self.std == 0): warnings.warn("Some values of Y have standard deviation of zero. Resetting to 1.0 to avoid divide by zero errors.") - self.std[np.where(self.std==0)]=1. + # Choice of setting to 1.0 is somewhat arbitrary. It avoids a divide by zero error, but setting to EPS would also do this. Don't have strong reasons for choosing 1.0, it was just first instinct + self.std[np.where(self.std==0)]=1. def normalize(self, Y): super(Standardize, self).normalize(Y)