where \(\operatorname{sim}(\cdot , \cdot )\)  is the cosine similarity, \(\mathbb {1}_{[k \ne i]} \in \lbrace 0,1\rbrace \)  is an indicator function that equals 1 iff \(k \ne i\) , and \(\tau \)  denotes a temperature parameter. The final loss for a mini-batch can be obtained by computing and summing up the loss function of all \(2 N\)  positive pairs (symmetrically) in this mini-batch. SimCLR paper denotes this loss as NT-\(\mathrm {Xent}\)  (the normalized temperature-scaled cross entropy loss), and meanwhile loss functions of the same format with small variances are also referred to as NCE (noise-contrastive estimation) [1]}, [2]}, [3]} loss and InfoNCE [4]}, [5]} loss.
Intuitively, this contrastive loss can be viewed as a softmax-based classification loss [4]}, [2]} which aims to classify samples from a mini-batch as positive examples and negative examples.
