Triplet Loss

  • Triplet loss is the improvement over the Contrastive Loss
  • Triplet loss expects one anchor, one positive and one negative point
  • It simultaneously minimizes the Euclidian Distance between positive and anchor
  • AND maximizes the Euclidian Distance between negative and anchor
  • As it works simultaneously it needs less amount of sample for convergence

[!def] Triplet Loss Formula
$$
loss = max(0, |x-x^+|^2 - |x-x^-|^2 + m)
$$