Code for the paper "Generative Models and Model Criticism via Optimized Maximum Mean Discrepancy" (arXiv:1611.04488; published at ICLR 2017), by Dougal J. Sutherland (@dougalsutherland), Hsiao-Yu Tung, Heiko Strathmann (@karlnapf), Soumyajit De (@lambday), Aaditya Ramdas, Alex Smola, and Arthur Gretton.
- Implementations of the variance estimator are in Theano in
two_sample/mmd.py
and in Tensorflow ingan/mmd.py
. - General code for learning kernels for a fixed two-sample test, with Theano, is in two_sample.
- Code for the GAN variants, using TensorFlow, is in gan.
- Code for the efficient permutation test described in Section 3 is in the 6.0 release of Shogun; look under
shogun/src/shogun/statistical_testing
. An example of using it in the Python API is intwo_sample/mmd_test.py
.
This code is under a BSD license, but if you use it, please cite the paper.