As per [1]}, we use NT-Xent as our contrastive loss. Let \(\text{sim}\left(u,v\right)\)  represent the cosine similarity between vectors \(u\)  and \(v\) . For outputted latent representations \(\hat{x}_{i}\)  and \(\hat{x}_{j}^{\prime }\) , the contrastive loss function \(\mathcal {L}\)  is defined as
\(\mathcal {L}(\hat{x}_{i}, \hat{x}_{j}^{\prime }) = -\log \frac{\exp \left(\text{sim}\left(\hat{x}_i, \hat{x}_j^{\prime }\right)/\tau \right)}{\sum ^{2M_1}_{k=1}\mathbb {1}_{[k\ne {i}]}\exp \left(\text{sim}\left(\hat{x}_i, \hat{x}_k^{\prime }\right)/\tau \right)},\) 
