Address #2754, accuracy issues with gpu_hist (#3793)

* Address windows compilation error

* Do not allow divide by zero in weight calculation

* Update tests
This commit is contained in:
Rory Mitchell
2018-10-15 17:50:31 +13:00
committed by GitHub
parent 516457fadc
commit f00fd87b36
3 changed files with 5 additions and 4 deletions

View File

@@ -292,7 +292,7 @@ XGBOOST_DEVICE inline T CalcGain(const TrainingParams &p, T sum_grad, T sum_hess
template <typename TrainingParams, typename T>
XGBOOST_DEVICE inline T CalcWeight(const TrainingParams &p, T sum_grad,
T sum_hess) {
if (sum_hess < p.min_child_weight) {
if (sum_hess < p.min_child_weight || sum_hess <= 0.0) {
return 0.0;
}
T dw;