tsgm.utils.mmd

Module Contents

kernel_median_heuristic(X1: tsgm.types.Tensor, X2: tsgm.types.Tensor) float[source]

Median heuristic (Gretton, 2012) for RBF kernel width.

mmd_diff_var(Kyy: tsgm.types.Tensor, Kzz: tsgm.types.Tensor, Kxy: tsgm.types.Tensor, Kxz: tsgm.types.Tensor) float[source]

Computes the variance of the difference statistic MMD_{XY} - MMD_{XZ} See http://arxiv.org/pdf/1511.04581.pdf Appendix A for more details.

mmd_3_test(X: tsgm.types.Tensor, Y: tsgm.types.Tensor, Z: tsgm.types.Tensor, kernel: Callable) Tuple[float, float, float, float][source]

Relative MMD test — returns a test statistic for whether Y is closer to X or than Z. See http://arxiv.org/pdf/1511.04581.pdf