Skip to content
AI360Xpert
Glossary
Definition

Triplet Loss

A loss function used to train embedding models by mathematically pulling a baseline example closer to a matching example while pushing away a mismatch.

Think of It Like This

Like a teacher moving two best friends to sit closer together in class, while intentionally moving a disruptive student far away from them.

It operates on triplets of data: an Anchor, a Positive (same class), and a Negative (different class). The loss enforces that the distance between the anchor and the positive is significantly smaller than the distance to the negative by a defined margin. It is crucial for training facial recognition and semantic search models.