Mask in losses.py
BingCS opened this issue Β· comments
Hi Zixin,
I noticed that you apply a mask (line.134 of losses.py) with a threshold of 0.008. May I know the rules to select this value?
Best,
Bing
Hi Bing,
This threshold is used to filter too hard negative samples, or to mitigate the noise (incorrect gt correspondences) in the training data, which might harm the performance. This is also used in hardnet.
Hi Jiahui,
Many thanks for your kind reply. To safely remove such samples, "dist_mat_without_min_on_diag" (line 136) should plus "mask*10" as HardNet does instead of "mask". Have I got that right?
Best,
Bing
For normalized features, the maximum of dist mat is 1.0, so it is ok to plus "mask". "+mask*10" is indeed a more safe way.
Hi Jiahui,
If βπ₯β=βπ¦β=1, the triangle inequality gives βπ₯βπ¦ββ€βπ₯β+βπ¦β=2. Thus, the values in dist_mat should range from 0.0 to 2.0. It might not be safe to just plus "mask".
Best,
Bing
Sorry, you are right. But I think this might only have a slight impact. I will fix it.
thanks for the issue, fixed.