提交 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, ...@@ -462,8 +462,8 @@ void LambdaCost::calcGrad(const real* outputScore,
real score_j = score[index_j]; real score_j = score[index_j];
real dcgDif = 0; real dcgDif = 0;
if (j < sortSize) { if (j < sortSize) {
dcgDif = (std::pow(2, score_i) - std::pow(2, score_j)) / dcgDif = (std::pow(2, score_i) - std::pow(2, score_j)) *
(std::log(i + 2) - std::log(j + 2)); (1 / std::log(i + 2) - 1 / std::log(j + 2));
} else { } else {
dcgDif = dcgDif =
(std::pow(2, score_i) - std::pow(2, score_j)) / std::log(i + 2); (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.
先完成此消息的编辑!
想要评论请 注册