diff --git a/GPy/kern/_src/rbf.py b/GPy/kern/_src/rbf.py index 65b65120..4fc2b591 100644 --- a/GPy/kern/_src/rbf.py +++ b/GPy/kern/_src/rbf.py @@ -169,6 +169,8 @@ class RBF(Kern): dZ = self._psi2[:, :, :, None] * (term1[None] + term2) grad += (dL_dpsi2[:, :, :, None] * dZ).sum(0).sum(0) + grad += self.gradients_X(dL_dKmm, Z, None) + return grad def gradients_muS_variational(self, dL_dKmm, dL_dpsi0, dL_dpsi1, dL_dpsi2, mu, S, Z): @@ -184,8 +186,6 @@ class RBF(Kern): return grad_mu, grad_S - - def gradients_X(self, dL_dK, X, X2=None): #if self._X is None or X.base is not self._X.base or X2 is not None: self._K_computations(X, X2) @@ -203,7 +203,7 @@ class RBF(Kern): # PSI statistics # #---------------------------------------# - #---------------------------------------# + #---------------------------------------# # Precomputations # #---------------------------------------#