Open deep0learning opened 5 years ago
@deep0learning Actually it's calculating the squared distance between anchors and negative or positives and choosing pairs following hard-batch triplet rule.
you can create fake inputs and targets and play with the code, then you'll figure it out.
Hi, Can you please explain the way you implement triplet loss a little bit. I implement triplet loss like that. But I do not understand your implementation. `class TripletLoss(nn.Module): """ Triplet loss Takes embeddings of an anchor sample, a positive sample and a negative sample """
`