Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

since pot.emd2 returns accurate distance, how could the results have gradient when torch tensor passed in? #750

Unanswered
chansigit asked this question in Q&A
Discussion options

i thought only sinkhorn methods enables gradient calculation due to iterative evaluation. how could EMD also support gradient calculation?

You must be logged in to vote

Replies: 1 comment

Comment options

It actually returns sub-gradients because indeed it is not differentiable but similarly to relu that is not differentiable, sub-gradient are quite sufficient for many optimization tasks (but less stable especially if you compute gradients wrt weights)

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #747 on August 13, 2025 14:11.

AltStyle によって変換されたページ (->オリジナル) /