Questions tagged [triplet-loss-function]
8 questions
5
votes
1 answer
What is the difference between the triplet loss and the contrastive loss?
What is the difference between the triplet loss and the contrastive loss?
They look same to me. I don't understand the nuances between the two. I have the following queries:
When to use what?
What are the use cases and advantages or disadvantages…

Exploring
- 223
- 6
- 16
2
votes
2 answers
Why does triplet loss allow to learn a ranking whereas contrastive loss only allows to learn similarity?
I am looking at this lecture, which states (link to exact time):
What the triplet loss allows us in contrast to the contrastive loss is
that we can learn a ranking. So it's not only about similarity, being
closer together or being further apart,…

Gulzar
- 729
- 1
- 8
- 23
1
vote
2 answers
Triplet Loss- Three forward pass and one backward pass(Propagation)
I am trying to build a CNN model based on the concepts of Contrastive Learning. In specific based on Triplet loss.
I have 5 different class labels and I create triplets such that in a triplet, two images are from the same class and the third one is…

Raj Rajeshwari Prasad
- 123
- 3
0
votes
1 answer
What architecture is used for deep quadruplet network for person re-identification
I am trying to implement the paper Beyond triplet loss: a deep quadruplet network for person re-identification. In the paper, they provide a figure (attached below) containing the network architecture, but they don't specify the exact kernel…
0
votes
0 answers
How to fix the embedding gauge in a BERT-like model?
I have a pre-trained BERT model from Huggingface, which I tune to categorize short texts (like tweets or slightly longer) into several thousand categories using triplet loss.
As I understand, if I train two models on the same dataset, the resulting…

Gena Kukartsev
- 101
- 2
0
votes
1 answer
Why is the time complexity of the Triplet Loss $O(N^3)$
The triplet loss function uses an anchor, positive, and negative examples. If $N$ are the number of examples in the training set with $C$ classes, then I think that the time complexity should be $O(NN_cN_{c'})$ not $O(N^3)$ from Probabilistic…

wd violet
- 103
- 5
0
votes
1 answer
Does this modified version of the triplet loss function introduced with SBERT that uses the cosine similarity make sense?
I am working on a modified version of the triplet loss function introduced with SBERT, where instead of the Euclidean distance we use the cosine similarity. The formula to minimize is max( (|s_a*s_p| / |s_a|*|s_p|) - (|s_a*s_n| / |s_a|*|s_n|) + e,…

albus_c
- 105
- 5
0
votes
1 answer
How to retrain a Facenet model with the triplet loss function?
I want to calculate the similarity or distance of two faces. I'm using Python.
I have read and done what this tutorial says. However, the result is not good (the similarity of same faces and similarity of different faces are very very very close to…

behrad
- 101
- 1