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

Bugs for euclidean dist #104

Open
cxmscb opened this issue May 9, 2023 · 0 comments
Open

Bugs for euclidean dist #104

cxmscb opened this issue May 9, 2023 · 0 comments

Comments

@cxmscb
Copy link

cxmscb commented May 9, 2023

Hello, I'm sorry to disturb you.
I check the codes for euclidean dist.
norm_degree = 2 if dist == "cos": non_match_loss = (non_matches_a_descriptors * non_matches_b_descriptors).sum(dim=-1) else: non_match_loss = (non_matches_a_descriptors - non_matches_b_descriptors).norm(norm_degree, 1) if not invert: non_match_loss = torch.clamp(M - non_match_loss, min=0).pow(2) else: if dist == "cos": non_match_loss = torch.clamp(non_match_loss - M, min=0) else: non_match_loss = torch.clamp(non_match_loss - M, min=0).pow(2)

There is a bug in the non_match_loss for euclidean dist. The following code will make the euclidean dist for no-match pairs small.

non_match_loss = torch.clamp(non_match_loss - M, min=0).pow(2)

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