Skip to content

Using NTXentLoss with PairMarginMiner in different distance functions #555

Answered by HaominJiang
HaominJiang asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, Kevin. @KevinMusgrave

I think this discussion can be closed. After my deeper research on NTXentLoss and SupConLoss, I found that both of them have "intrinsic ability to perform hard positive/negative mining" (chapter 3.2.2 from paper https://arxiv.org/abs/2004.11362). So maybe we don't need apply a miner along with these loss functions.

For a more detailed explanation, we could find that:

  • When temperature τ gets larger, the function graph of q*k/ τ becomes flatter, which means the different negative samples will have a similar product to an anchor. In other words, the the loss function will ignore more difference between negative samples.
  • When temperature τ gets smaller, the function…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by KevinMusgrave
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #548 on November 28, 2022 19:31.