@abstractmethod
    def estimateMMD(self,sample1,sample2,unbiased=False):
        K11 = self.kernel(sample1,sample1)
        K22 = self.kernel(sample2,sample2)
        K12 = self.kernel(sample1,sample2)
        if unbiased:
            fill_diagonal(K11,0.0)
            fill_diagonal(K22,0.0)
            n=float(shape(K11)[0])
            m=float(shape(K22)[0])
            return sum(sum(K11))/(pow(n,2)-n) + sum(sum(K22))/(pow(m,2)-m) - 2*mean(K12[:])
        else:
            return mean(K11[:])+mean(K22[:])-2*mean(K12[:])
Compute the MMD between two samples
dataset/ETHPy150Open karlnapf/kameleon-mcmc/kameleon_mcmc/kernel/Kernel.py/Kernel.estimateMMD