Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing coefficient for cross term in MMD #3

Open
nik-sm opened this issue Jul 7, 2021 · 0 comments
Open

Missing coefficient for cross term in MMD #3

nik-sm opened this issue Jul 7, 2021 · 0 comments

Comments

@nik-sm
Copy link

nik-sm commented Jul 7, 2021

Apologies if I'm missing something obvious, but the estimate defined in equation (3) of https://www.jmlr.org/papers/volume13/gretton12a/gretton12a.pdf looks slightly different to the MMD estimate implemented here.

The first term makes sense to me, and subtracting m accounts for the summation over i != j (since diagonal of RBF kernel will add to m). Likewise for second term.
However the third term seems to be missing a factor 1 / (m*n).

m = K_XX.shape[0]
n = K_YY.shape[0]
mmd2 = ((K_XX.sum() - m) / (m * (m - 1))
+ (K_YY.sum() - n) / (n * (n - 1))
- 2 * K_XY.mean())

Is this implementation intended to match the estimate linked above?

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant