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

add option to randomly sample negative pairs #56

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jessica-ewald
Copy link
Contributor

Add an optional parameter to the "average_precision" function called "sample_neg" that enables random sampling of the negative pairs prior to pairwise cosine distance calculation.

If "sample_neg" is between 0 and 1, sampling is done by percentage (ie. sample_neg = 0.2, then 20% of neg_pairs are sampled).

If "sample_neg" is greater than 1, sampling is done by size (ie. sample_neg = 10 000, then 10 000 neg_pairs are sampled).

The default value for "sample_neg" is 1 - in this case, no sampling is performed.

@johnarevalo johnarevalo self-requested a review February 6, 2024 17:04
@shntnu
Copy link
Member

shntnu commented Sep 30, 2024

@alxndrkalinin and I discussed this today; Alex will update with his notes.

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

Successfully merging this pull request may close these issues.

2 participants