Open
Description
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)
Metadata
Metadata
Assignees
Labels
No labels