lambda cost bug's fix

revert-4814-Add_sequence_project_op
chengxingyi 7 years ago
parent 78327c8ec3
commit 7f0c823093

@ -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);

Loading…
Cancel
Save