From 943be980d4b4625d8d663dbd829049cef581202f Mon Sep 17 00:00:00 2001 From: Neil Lawrence Date: Wed, 19 May 2021 09:55:13 +0100 Subject: [PATCH] Fix normalizer to catch when output scale is zero. --- GPy/util/normalizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPy/util/normalizer.py b/GPy/util/normalizer.py index 4fe9815c..07716bc9 100644 --- a/GPy/util/normalizer.py +++ b/GPy/util/normalizer.py @@ -90,7 +90,7 @@ class Standardize(_Norm): Y = np.ma.masked_invalid(Y, copy=False) self.mean = Y.mean(0).view(np.ndarray) self.std = Y.std(0).view(np.ndarray) - if np.any(self.std) == 0: + if np.any(self.std == 0): self.std[np.where(Y_std==0)]=1. warnings.warn("Some values of Y have standard deviation of zero. Resetting to 1.0 to avoid divide by zero errors.")