Commit fca93b78 authored by Guolin Ke's avatar Guolin Ke
Browse files

cannot reset random object in reset_parameters

parent 9a54ee3e
...@@ -57,7 +57,6 @@ public: ...@@ -57,7 +57,6 @@ public:
const std::vector<const Metric*>& training_metrics) { const std::vector<const Metric*>& training_metrics) {
GBDT::ResetTrainingData(config, train_data, object_function, training_metrics); GBDT::ResetTrainingData(config, train_data, object_function, training_metrics);
shrinkage_rate_ = 1.0; shrinkage_rate_ = 1.0;
random_for_drop_ = Random(gbdt_config_->drop_seed);
} }
/*! /*!
......
...@@ -46,7 +46,10 @@ void GBDT::ResetTrainingData(const BoostingConfig* config, const Dataset* train_ ...@@ -46,7 +46,10 @@ void GBDT::ResetTrainingData(const BoostingConfig* config, const Dataset* train_
} }
early_stopping_round_ = new_config->early_stopping_round; early_stopping_round_ = new_config->early_stopping_round;
shrinkage_rate_ = new_config->learning_rate; shrinkage_rate_ = new_config->learning_rate;
// cannot reset seed, only create one time
if (gbdt_config_ == nullptr ) {
random_ = Random(new_config->bagging_seed); random_ = Random(new_config->bagging_seed);
}
// create tree learner, only create once // create tree learner, only create once
if (gbdt_config_ == nullptr) { if (gbdt_config_ == nullptr) {
......
...@@ -111,7 +111,6 @@ void SerialTreeLearner::ResetConfig(const TreeConfig* tree_config) { ...@@ -111,7 +111,6 @@ void SerialTreeLearner::ResetConfig(const TreeConfig* tree_config) {
} }
histogram_pool_.ResetConfig(tree_config_, train_data_->num_features()); histogram_pool_.ResetConfig(tree_config_, train_data_->num_features());
random_ = Random(tree_config_->feature_fraction_seed);
} }
Tree* SerialTreeLearner::Train(const score_t* gradients, const score_t *hessians) { Tree* SerialTreeLearner::Train(const score_t* gradients, const score_t *hessians) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment