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

lambda cost bug's fix

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