allegro/allRank

LambdaRank implementation in lambdaloss.py

Closed this issue · 6 comments

I find a discrepancy between the loss formula in the paper and the LambdaRank's loss in lambdaloss.py.
image
Is it true or am I missing anything?
Thank you.

dmh43 commented

The implementation seems correct to me. I think you are missing a sigmoid in your definition of scores_diffs in the image you shared.

@dmh43 Thanks for the reply. The sigmoid is the σ sign in front of the scores_diffs.
The correct implementation is the first equation in LambdaRank, but the equation in Lambdaloss.py is not equivalent to the LambdaRank, correct?

dmh43 commented

Oh I see, I think there's some confusion on the notation. In the Burges paper that defines lambdarank, $\sigma$ is the growth rate parameter of the logistic function, not the function itself (scroll down further and it will become clear. Anyway it does not really make sense to take a sigmoid twice in a row (recall that log(1+e^-x) = log sigmoid(x))).

Yes, we tried to keep close to the original paper. Unfortunately, sometimes it may lead to confusing notation. The sigma parameter is the exponent of the logistic function, just as @dmh43 wrote.

Thank you, it is very encouraging to see not only a new issue but also a solution coming from someone other than the original contributors.

@mohuzi If you have any further questions regarding the LambdaLoss implementation, please feel free to ask. If not, you can close this issue.

All good now. Thanks for the clarification.

dmh43 commented

@sadaharu-inugami You all did an incredible job with this codebase. Thanks so much for sharing it. Also the work on contextual ranking powered by this repo was also insightful to read.