yxgeee / MMT

[ICLR-2020] Mutual Mean-Teaching: Pseudo Label Refinery for Unsupervised Domain Adaptation on Person Re-identification.
https://yxgeee.github.io/projects/mmt
MIT License
469 stars 73 forks source link

One question about Euclidean computation #12

Closed hezhping closed 4 years ago

hezhping commented 4 years ago

There are two lines code in function _compute_jaccard_dist_ original_dist = torch.pow(target_features, 2).sum(dim=1, keepdim=True) 2 original_dist = original_dist.expand(N, N) - 2 torch.mm(target_features, target_features.t()) I think it should be: original_dist = torch.pow(target_features, 2).sum(dim=1, keepdim=True) original_dist = original_dist.expand(N, N) + original_dist.t().expand(N,N) - 2 * torch.mm(target_features, target_features.t())

yxgeee commented 4 years ago

Hi, you’re right. But the results are actually the same, because the features are normalized.

yxgeee commented 4 years ago

I will revise it for better understanding. Thanks!

hezhping commented 4 years ago

Hi, you’re right. But the results are actually the same, because the features are normalized.

Yep, thank you for your reply, I am trying your code recently, its results really impressed me. Thank you.

yxgeee commented 4 years ago

Hi, This issue has been fixed in OpenUnReID/core/utils/compute_dist.py, and welcome to use our refactored code!