def getDerMatrix(self,x=None,z=None,mode=None,der=None):
        self.checkInputGetDerMatrix(x,z,mode,der)
        ell = np.exp(self.hyp)            # ARD parameters
        if not x is None:
            n, D = x.shape
        if not z is None:
            nn, D = z.shape
        if der < D:
            if mode == 'self_test':
                tem = np.atleast_2d(z[:,der]).T
                A = -2.* tem * tem
            elif mode == 'train':
                A = -2.*np.dot(np.atleast_2d(x[:,der]).T,np.atleast_2d(x[:,der]))
            elif mode == 'cross':
                z = np.dot(z,np.diag(old_div(1.,ell)))
                A = -2.*np.dot(np.atleast_2d(x[:,der]).T, np.atleast_2d(z[:,der])) # cross covariances
        else:
            raise Exception("Wrong derivative index in covLINard")
        return A
dataset/ETHPy150Open marionmari/pyGPs/pyGPs/Core/cov.py/LINard.getDerMatrix/original