The NTXent is a contrastive loss [1]} that takes as input a batch \(P^+\)  of positive pairs of embedded speech sequences \(P^+=((z_0,z_0^+),(z_1,z_1^+),...,(z_n,z_n^+))\) . For each item taken from a positive pair, all remaining \(2(n-1)\)  items from the other pairs are used to form negative pairs. This loss minimizes the distance within the positive pairs while maximizing the distance within the negative pairs. For each item \(z_i \in P^+\) , the loss function is written:
\(L_{nce}(z_i,P^+)=-log(\frac{\exp (sim(z_i,z_i^+)/\tau )}{\sum _{j\le 2n j\ne i}\exp (sim(z_i,z_j)/\tau )})\) 
