What is the difference between contrastive loss and triplet loss?
Role: Machine Learning Engineer
Category: Machine Learning
Difficulty: medium
Interview Round: Other
Overview: Asks how contrastive loss and triplet loss differ for training embedding models. Tests understanding of pairwise versus relative distance constraints, margins, how each shapes the embedding space, and why triplet training depends on hard negative mining.