diff --git a/GPy/kern/src/stationary.py b/GPy/kern/src/stationary.py index c10384bb..79d4b954 100644 --- a/GPy/kern/src/stationary.py +++ b/GPy/kern/src/stationary.py @@ -135,7 +135,7 @@ class Stationary(Kern): #X2, = self._slice_X(X2) X1sq = np.sum(np.square(X),1) X2sq = np.sum(np.square(X2),1) - r2 = -2.*np.dot(X, X2.T) + X1sq[:,None] + X2sq[None,:] + r2 = -2.*np.dot(X, X2.T) + (X1sq[:,None] + X2sq[None,:]) r2 = np.clip(r2, 0, np.inf) return np.sqrt(r2)