Closed mcschmitz closed 11 months ago
A PR would be very much appreciated!
As mentioned in the pull request, I think this is equivalent to NTXentLoss with a customized reducer:
from pytorch_metric_learning.losses import NTXentLoss
from pytorch_metric_learning.reducers import AvgNonZeroReducer, PerAnchorReducer
loss_fn = NTXentLoss(reducer=PerAnchorReducer(AvgNonZeroReducer()))
Hi all!
I'd be great if we could add MultipleNegativesRankingLoss as used in the sentece bert model and introduced in Efficient Natural Language Response Suggestion for Smart Reply. I can provide a PR if you're interested.