tripletselectlayer possible bug?
TuBui opened this issue · 1 comments
TuBui commented
Hi, thanks for the code.
In tripletselectlayer.py line 71-73:
bottom[0].diff[self.tripletlist[i][0]] = top[0].diff[i]
bottom[0].diff[self.tripletlist[i][1]] = top[1].diff[i]
bottom[0].diff[self.tripletlist[i][2]] = top[2].diff[i]
Since an image can be selected twice in self.tripletlist (e.g. [[0,10,100], [1,100,8]...] here image id 100 appears as the hard negative sample for anchor 0, but hard positive sample for anchor 1), I suggest changing to code line 71-73 to:
bottom[0].diff[self.tripletlist[i][0]] += top[0].diff[i]
bottom[0].diff[self.tripletlist[i][1]] += top[1].diff[i]
bottom[0].diff[self.tripletlist[i][2]] += top[2].diff[i]
Do u agree?