

def Kdiag(self, X, target):
    'Compute the diagonal of the covariance matrix associated to X.'
    foo = np.zeros((X.shape[0], X.shape[0]))
    self.K(X, X, foo)
    target += np.diag(foo)

dataset/ETHPy150Open SheffieldML/GPy/GPy/kern/src/todo/symmetric.py Symmetric.Kdiag/original