def getDerMatrix(self,x=None,z=None,mode=None,der=None):
        self.checkInputGetDerMatrix(x,z,mode,der)
        tol = 1.e-9                       # Tolerance for declaring two vectors "equal"
        s2 = np.exp(2.*self.hyp[0])       # noise variance
        if mode == 'self_test':           # self covariances for the test cases
            nn,D = z.shape
            A = np.zeros((nn,1))
        elif mode == 'train':             # compute covariance matix for dataset x
            n,D = x.shape
            A = np.eye(n)
        elif mode == 'cross':             # compute covariance between data sets x and z
            M = spdist.cdist(x, z, 'sqeuclidean')
            A = np.zeros_like(M,dtype=np.float)
            A[M < tol] = 1.
        if der == 0:
            A = 2.*s2*A
        else:
            raise Exception("Wrong derivative index in covNoise")
        return A
dataset/ETHPy150Open marionmari/pyGPs/pyGPs/Core/cov.py/Noise.getDerMatrix/original