MatchSum icon indicating copy to clipboard operation
MatchSum copied to clipboard

About the triplet loss

Open ShibataGenjiro opened this issue 4 years ago • 0 comments

Hi,

I have a question about the calculation of triplet loss.

For example, for a certain document, you have 4 candidate sentences, {s1,s2,s3,s4} (Rouge s1 > Rouge s2 > Rouge s3 > Rouge s4).

When calculating the triplet loss, how many times should be summed?

In other words, the loss for this document is :

max(0, f(D, s2 ) − f(D, s1) + (2 − 1) ∗ γ2) + max(0, f(D, s3 ) − f(D, s1) + (3 − 1) ∗ γ2)+max(0, f(D, s4 ) − f(D, s1) + (4 − 1) ∗ γ2) 3 times

or

max(0, f(D, s2 ) − f(D, s1) + (2 − 1) ∗ γ2) + max(0, f(D, s3 ) − f(D, s1) + (3 − 1) ∗ γ2) + max(0, f(D, s4 ) − f(D, s1) + (4 − 1) ∗ γ2) + max(0, f(D, s3 ) − f(D, s2) + (3 − 2) ∗ γ2) + max(0, f(D, s4 ) − f(D, s2) + (4 − 2) ∗ γ2) + max(0, f(D, s4 ) − f(D, s3) + (4 − 3) ∗ γ2) 6 times

That is to say, how many positive sentence(s) in this case, only 1 (s1) , or relatively 3 (s1 , s2, s3 ) sentences?

Thank you very much!

ShibataGenjiro avatar Jan 14 '21 09:01 ShibataGenjiro