Integer gradient summation for GPU histogram algorithm. (#2681)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user