c-sts
c-sts copied to clipboard
The way to generate positive and negative pairs in Quad loss.
Thanks for your kind contribution. When I read 'modeling_encoders,py', I cannot understand the way to generate positive pairs and negative pairs in Quad loss. For example, in class BiEncoderForClassification:
positives1, negatives1 = torch.split(features_1, bsz // 2, dim=0)
positives2, negatives2 = torch.split(features_2, bsz // 2, dim=0)
Does this mean that the batch size must be 2 to make a batch of data only include the same pair of sentences with different conditions?