Skip to content

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

@HungryFlo

Description

@HungryFlo

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions