mihaidusmanu / d2-net

D2-Net: A Trainable CNN for Joint Description and Detection of Local Features
Other
764 stars 163 forks source link

the positive distance is consistent with the paper L2 distance #42

Closed fantuslk closed 4 years ago

fantuslk commented 4 years ago

Hi mihaidusmanu, In the paper,the p(c)=||dA-dB||2.In the code,loss.py 86 line, positive_distance = 2 - 2 * ( descriptors1.t().unsqueeze(1) @ descriptors2.t().unsqueeze(2) ).squeeze(). They are not equal.

mihaidusmanu commented 4 years ago

I am not sure I understand what you mean. The descriptors are L2 normalized on lines 54 and 57 respectively, so the squared L2 distance can be formulated as in the code.

fantuslk commented 4 years ago

Thank you for your reply.I know.