Write the contrastive loss function for SimCLR

Contrastive loss function: L = (1/2N) Σ [max(0, margin - y_i * (z_i - z_j))² + max(0, y_i * (z_i - z_j) - margin)²]

Image: Neoclassicism Enthusiast, CC BY-SA 4.0, via Wikimedia Commons

Write the contrastive loss function for SimCLR

Contrastive loss function: L = (1/2N) Σ [max(0, margin - y_i * (z_i - z_j))² + max(0, y_i * (z_i - z_j) - margin)²]

Related concepts

One email a day: 5 concepts + the 5 stories that matter →

Swipe through 100 ML concepts daily

Open TickerNews