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
472 stars 73 forks source link

SoftTripletLoss margin #13

Closed pmorerio closed 4 years ago

pmorerio commented 4 years ago

Hi, first of all thanks for sharing such great code. Can I ask you the meaning of setting margin=0.0 versus margin=None in the MMTTrainer? Inspecting the SoftTripletLoss class looks like margin=None implements equation 8 in the paper, while setting the margin to any float would boil it down to equation 6. Am I correct? Thank you very much.

https://github.com/yxgeee/MMT/blob/aeb547079c65d9aa2b8ce08d587970412d362b07/mmt/trainers.py#L172 https://github.com/yxgeee/MMT/blob/aeb547079c65d9aa2b8ce08d587970412d362b07/mmt/trainers.py#L173

yxgeee commented 4 years ago

Hi, your understanding is exactly right. When setting the margin to a float number like 0.0, (1-margin) becomes the label in equation 6, e.g. 1 in our paper.

pmorerio commented 4 years ago

Thank you very much!