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

Added the MMD Metric and tests #152

Merged
merged 3 commits into from
Jan 8, 2023

Conversation

danieltudosiu
Copy link
Contributor

Added the MMD Metric and required tests.

@Warvito for the tests I tried to create two normal distributions and the MMD metric resulted in a 0.3 value.

I have had a try with the code from torch-two-sample at different alphas bigger than 0 and they also return a non-zero value.

I also had a go at the original code from the alpha WGAN paper and it as well returns a non-zero value.

Given that MMD is a differentiable metric like SSIM should we also implement and test a loss?

Signed-off-by: Petru-Daniel Tudosiu <petru.daniel@tudosiu.com>
@danieltudosiu danieltudosiu linked an issue Dec 20, 2022 that may be closed by this pull request
@Warvito
Copy link
Collaborator

Warvito commented Dec 21, 2022

Thanks for implementing! I think just the metric is enough for now, Dan.

@danieltudosiu
Copy link
Contributor Author

Ok, then please review it and if you consider it ok merge it.

I have also included a transformation which can be seen as applying different kernels to the data such as gaussian or laplace or as in our publications the MedNet3D.

Copy link
Collaborator

@Warvito Warvito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I left a few comments regarding the docstrings, and there is a step that I think it might have a bug. could please check it, and "re-assign review needed" after done?

generative/metrics/mmd.py Outdated Show resolved Hide resolved
generative/metrics/mmd.py Outdated Show resolved Hide resolved
generative/metrics/mmd.py Outdated Show resolved Hide resolved
@Warvito Warvito merged commit cd7d30a into main Jan 8, 2023
@Warvito Warvito deleted the 105-add-maximum-mean-discrepancy-metric branch January 8, 2023 12:58
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

Successfully merging this pull request may close these issues.

Add Maximum Mean Discrepancy metric
2 participants