Integer gradient summation for GPU histogram algorithm. (#2681)

This commit is contained in:
Rory Mitchell
2017-09-08 15:07:29 +12:00
committed by GitHub
parent 15267eedf2
commit e6a9063344
15 changed files with 182 additions and 128 deletions

View File

@@ -109,10 +109,8 @@ class LambdaRankObj : public ObjFunction {
bst_float g = p - 1.0f;
bst_float h = std::max(p * (1.0f - p), eps);
// accumulate gradient and hessian in both pid, and nid
gpair[pos.rindex].grad += g * w;
gpair[pos.rindex].hess += 2.0f * w * h;
gpair[neg.rindex].grad -= g * w;
gpair[neg.rindex].hess += 2.0f * w * h;
gpair[pos.rindex] += bst_gpair(g * w, 2.0f*w*h);
gpair[neg.rindex] += bst_gpair(-g * w, 2.0f*w*h);
}
}
}