Skip to content

Commit

Permalink
Revert "Restore non-negative requirement."
Browse files Browse the repository at this point in the history
This reverts commit ca4688c.
  • Loading branch information
trivialfis committed Sep 29, 2021
1 parent ca4688c commit 12b0b12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/objective/regression_obj.cu
Expand Up @@ -421,7 +421,7 @@ class GammaRegression : public ObjFunction {
bst_float p = _preds[_idx];
bst_float w = is_null_weight ? 1.0f : _weights[_idx];
bst_float y = _labels[_idx];
if (y < 0.0f) {
if (y <= 0.0f) {
_label_correct[0] = 0;
}
_out_gpair[_idx] = GradientPair((1 - y / expf(p)) * w, y / expf(p) * w);
Expand All @@ -433,7 +433,7 @@ class GammaRegression : public ObjFunction {
std::vector<int>& label_correct_h = label_correct_.HostVector();
for (auto const flag : label_correct_h) {
if (flag == 0) {
LOG(FATAL) << "GammaRegression: label must be non-negative.";
LOG(FATAL) << "GammaRegression: label must be positive.";
}
}
}
Expand Down

0 comments on commit 12b0b12

Please sign in to comment.