Closed arita37 closed 3 years ago
Triplet loss can be thought as a ranking loss or pairwise ranking loss. The main difference is conceptually: ranking loss deals with queries and documents, distance(q, d+) < distance(q, d-) while triplet loss deals with the same type of items, like documents and documents, distance(d, d+) < distance(d, d-).
Essentially, if we use items as queries, then they become more or less equivalent mathematically. You can extend to listwise ranking losses based on the above connection.
For traditional ranking problems, both positives and negatives are usually presented. I think the negative sampler is needed when there are only positive ones. The implementation of negative samplers can be different, but loss computation should be almost similarly for ranking losses or triplet losses.
In another word, ranking losses include more variants than triplet losses.
close this by now and feel free to ropen.
Some questions on the new TF ranking version:
1) Is triplet losses considered as ranking losses ? 2) How does it “located” among pairwise and listwise losses ?
3) what about the impact of negative sampler ?