提交 5c5250e3 编写于 作者: T Tao Luo 提交者: GitHub

Merge pull request #4777 from cxysteven/develop

lambdaCost layer's bug fix
......@@ -462,8 +462,8 @@ void LambdaCost::calcGrad(const real* outputScore,
real score_j = score[index_j];
real dcgDif = 0;
if (j < sortSize) {
dcgDif = (std::pow(2, score_i) - std::pow(2, score_j)) /
(std::log(i + 2) - std::log(j + 2));
dcgDif = (std::pow(2, score_i) - std::pow(2, score_j)) *
(1 / std::log(i + 2) - 1 / std::log(j + 2));
} else {
dcgDif =
(std::pow(2, score_i) - std::pow(2, score_j)) / std::log(i + 2);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册