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

Computation of Sliced Wasserstein Distance numerically unstable #28

Closed
banelli opened this issue May 3, 2020 · 1 comment
Closed

Computation of Sliced Wasserstein Distance numerically unstable #28

banelli opened this issue May 3, 2020 · 1 comment

Comments

@banelli
Copy link

banelli commented May 3, 2020

The function _normalize_patches() defined and used here in tensorflow_gan.python.eval.sliced_wasserstein divides by the standard deviation of the values within a patch. To respect the case where the standard deviation is zero I suggest to add a small constant for numerical stability here:

patches = (patches - mean) / (tf.sqrt(variance) + 1.0e-12)

@joel-shor
Copy link
Contributor

This is a good observation, but would change the value of the eval metric and make it incomparable to previously reported numbers. It might be worth proposing an alternate metric, and naming it something different!

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

2 participants