modbot.utilities.loss_metrics.max_mean_discrepancy
- modbot.utilities.loss_metrics.max_mean_discrepancy(x1, x2, beta=1.0)[source]
maximum mean discrepancy (MMD) based on Gaussian kernel function for keras models (theano or tensorflow backend) - Gretton, Arthur, et al. “A kernel method for the two-sample-problem.” Advances in neural information processing systems. 2007.
- Parameters
x1 (tf.tensor) – predictions
x2 (tf.tensor) – ground truth
beta (float) – scaling parameter for gaussian kernel
- Return type
tf.tensor