c-sts icon indicating copy to clipboard operation
c-sts copied to clipboard

The way to generate positive and negative pairs in Quad loss.

Open HungryFlo opened this issue 9 months ago • 0 comments

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?

HungryFlo avatar May 05 '24 15:05 HungryFlo