From a3679b9f6135a5103e2a67514be68dff8866aa93 Mon Sep 17 00:00:00 2001 From: James Hensman Date: Thu, 2 Apr 2015 22:37:32 +0100 Subject: [PATCH] small bugfix in white kernel --- GPy/kern/_src/static.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GPy/kern/_src/static.py b/GPy/kern/_src/static.py index f4223bf4..7f59f5df 100644 --- a/GPy/kern/_src/static.py +++ b/GPy/kern/_src/static.py @@ -60,7 +60,10 @@ class White(Static): return np.zeros((Z.shape[0], Z.shape[0]), dtype=np.float64) def update_gradients_full(self, dL_dK, X, X2=None): - self.variance.gradient = np.trace(dL_dK) + if X2 is None: + self.variance.gradient = np.trace(dL_dK) + else: + self.variance.gradient = 0. def update_gradients_diag(self, dL_dKdiag, X): self.variance.gradient = dL_dKdiag.sum()