Contrastive Learning Contrastive Loss Resources https://lilianweng.github.io/posts/2021-05-31-contrastive/#contrastive-loss L=(1−y)⋅21D2+y⋅21{max(0,m−D)}2 Used for example in Siamese Networks.