提交 7f0c8230 编写于 作者: C chengxingyi

lambda cost bug's fix

上级 78327c8e
...@@ -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.
先完成此消息的编辑!
想要评论请 注册