reset learner
This commit is contained in:
parent
1931a70598
commit
1c666db349
@ -61,8 +61,6 @@
|
|||||||
#include "xgboost/predictor.h" // for PredictionContainer, PredictionCacheEntry
|
#include "xgboost/predictor.h" // for PredictionContainer, PredictionCacheEntry
|
||||||
#include "xgboost/string_view.h" // for operator<<, StringView
|
#include "xgboost/string_view.h" // for operator<<, StringView
|
||||||
#include "xgboost/task.h" // for ObjInfo
|
#include "xgboost/task.h" // for ObjInfo
|
||||||
#include <iostream>
|
|
||||||
#include <exception>
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const char* kMaxDeltaStepDefaultValue = "0.7";
|
const char* kMaxDeltaStepDefaultValue = "0.7";
|
||||||
@ -1267,9 +1265,7 @@ class LearnerImpl : public LearnerIO {
|
|||||||
void UpdateOneIter(int iter, std::shared_ptr<DMatrix> train) override {
|
void UpdateOneIter(int iter, std::shared_ptr<DMatrix> train) override {
|
||||||
monitor_.Start("UpdateOneIter");
|
monitor_.Start("UpdateOneIter");
|
||||||
TrainingObserver::Instance().Update(iter);
|
TrainingObserver::Instance().Update(iter);
|
||||||
|
|
||||||
this->Configure();
|
this->Configure();
|
||||||
|
|
||||||
this->InitBaseScore(train.get());
|
this->InitBaseScore(train.get());
|
||||||
|
|
||||||
if (ctx_.seed_per_iteration) {
|
if (ctx_.seed_per_iteration) {
|
||||||
@ -1286,20 +1282,11 @@ void UpdateOneIter(int iter, std::shared_ptr<DMatrix> train) override {
|
|||||||
monitor_.Stop("PredictRaw");
|
monitor_.Stop("PredictRaw");
|
||||||
|
|
||||||
monitor_.Start("GetGradient");
|
monitor_.Start("GetGradient");
|
||||||
try {
|
|
||||||
GetGradient(predt.predictions, train->Info(), iter, &gpair_);
|
GetGradient(predt.predictions, train->Info(), iter, &gpair_);
|
||||||
} catch (const std::exception& e) {
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
monitor_.Stop("GetGradient");
|
monitor_.Stop("GetGradient");
|
||||||
TrainingObserver::Instance().Observe(*gpair_.Data(), "Gradients");
|
TrainingObserver::Instance().Observe(*gpair_.Data(), "Gradients");
|
||||||
|
|
||||||
try {
|
|
||||||
gbm_->DoBoost(train.get(), &gpair_, &predt, obj_.get());
|
gbm_->DoBoost(train.get(), &gpair_, &predt, obj_.get());
|
||||||
} catch (const std::exception& e) {
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
monitor_.Stop("UpdateOneIter");
|
monitor_.Stop("UpdateOneIter");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user