Skip to content

Commit

Permalink
Only prepare tree_to_update on training
Browse files Browse the repository at this point in the history
  • Loading branch information
RAMitchell committed Apr 5, 2020
1 parent 23b079e commit 4544568
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/gbm/gbtree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ void GBTree::Configure(const Args& cfg) {

model_.Configure(cfg);

// for the 'update' process_type, move trees into trees_to_update
if (tparam_.process_type == TreeProcessType::kUpdate) {
model_.InitTreesToUpdate();
}

// configure predictors
if (!cpu_predictor_) {
cpu_predictor_ = std::unique_ptr<Predictor>(
Expand Down Expand Up @@ -112,6 +107,10 @@ void GBTree::ConfigureWithKnownData(Args const& cfg, DMatrix* fmat) {
this->updaters_.clear();
this->InitUpdater(cfg);
}
// for the 'update' process_type, move trees into trees_to_update
if (tparam_.process_type == TreeProcessType::kUpdate) {
model_.InitTreesToUpdate();
}
}

void GBTree::PerformTreeMethodHeuristic(DMatrix* fmat) {
Expand Down
1 change: 0 additions & 1 deletion src/predictor/cpu_predictor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ class CPUPredictor : public Predictor {
uint32_t const end_version = (tree_begin + real_ntree_limit) / output_groups;
// When users have provided ntree_limit, end_version can be lesser, cache is violated
if (predts->version > end_version) {
CHECK_NE(ntree_limit, 0);
this->InitOutPredictions(dmat->Info(), out_preds, model);
predts->version = 0;
}
Expand Down

0 comments on commit 4544568

Please sign in to comment.