Contrastive Loss

Contrastive Loss Formula

Loss=(1Y)|xixj|2+Ymax(0,m|xixj|2)

Here,

  • Y = 0 if sample is similar
  • Y = 1 if sample is different
  • m is a hyper-parameter

This loss mainly minimized the Euclidian Distance between similar points and increases the Euclidian Distance between different points till some limit m.


Related Notes