def getCovMatrix(self,x=None,z=None,mode=None):
        self.checkInputGetCovMatrix(x,z,mode)
        ell   = np.exp(self.hyp[0])       # characteristic length scale
        sf2   = np.exp(2.*self.hyp[1])    # signal variance
        alpha = np.exp(self.hyp[2])
        if mode == 'self_test':           # self covariances for the test cases
            nn,D = z.shape
            D2 = np.zeros((nn,1))
        elif mode == 'train':             # compute covariance matix for dataset x
            D2 = spdist.cdist(old_div(x,ell), old_div(x,ell), 'sqeuclidean')
        elif mode == 'cross':             # compute covariance between data sets x and z
            D2 = spdist.cdist(old_div(x,ell), old_div(z,ell), 'sqeuclidean')
        A = sf2 * ( ( 1.0 + 0.5*D2/alpha )**(-alpha) )
        return A
dataset/ETHPy150Open marionmari/pyGPs/pyGPs/Core/cov.py/RQ.getCovMatrix/original