Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
HungryFlo opened this issue May 5, 2024 · 0 comments
Open

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

HungryFlo opened this issue May 5, 2024 · 0 comments

Comments

@HungryFlo
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant