What is the difference between triplet loss and contrastive loss?

What is the difference between triplet loss and contrastive loss? They look same to me.

I don’t understand the nuances between the two. Can anyone please help me to understand the differences between the two?

Also how they are different from each other? When to use what? What’s the use case and advantage or disadvantage between the two?

Also how they fit with the siamese network discussion.

1 Like

triplet loss take three images, one posiitve, one negative, and one anchor image. where as contrastive loss take two input imaghs positive and negative.