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

About the computation of the EMD Loss #12

Open
qsisi opened this issue May 27, 2022 · 0 comments
Open

About the computation of the EMD Loss #12

qsisi opened this issue May 27, 2022 · 0 comments

Comments

@qsisi
Copy link

qsisi commented May 27, 2022

Hello! Thanks for open-sourcing this amazing work. Here I got a question about the EMD loss.

My intention is to understand the exact way of the computation for the EMD loss. So I changed this line:


to this:
return cost, match
In order to get the optimal transport matrix. Then see how to compute the cost from match.
Following:

from emd import EMDLoss
p1 = torch.rand(1, 1024, 3).cuda()
p2 = torch.rand(1, 1024, 3).cuda()
emd_loss = EMDLoss()
cost, match = emd_loss(p1, p2)

Even though I got the optimal transport matrix as match in the code, I still couldn't figure out how to compute the cost from match. To go through the cuda code is tough for me, so could you kindly help me with this?

Thank you very much for your help.

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