mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-06 02:24:17 +02:00
Update GPy/util/normalizer.py
This commit is contained in:
parent
ef90137c4c
commit
714ad858aa
1 changed files with 2 additions and 1 deletions
|
|
@ -92,7 +92,8 @@ class Standardize(_Norm):
|
||||||
self.std = Y.std(0).view(np.ndarray)
|
self.std = Y.std(0).view(np.ndarray)
|
||||||
if np.any(self.std == 0):
|
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.")
|
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):
|
def normalize(self, Y):
|
||||||
super(Standardize, self).normalize(Y)
|
super(Standardize, self).normalize(Y)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue