Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
fca93b78
Commit
fca93b78
authored
Dec 19, 2016
by
Guolin Ke
Browse files
cannot reset random object in reset_parameters
parent
9a54ee3e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
src/boosting/dart.hpp
src/boosting/dart.hpp
+0
-1
src/boosting/gbdt.cpp
src/boosting/gbdt.cpp
+4
-1
src/treelearner/serial_tree_learner.cpp
src/treelearner/serial_tree_learner.cpp
+0
-1
No files found.
src/boosting/dart.hpp
View file @
fca93b78
...
@@ -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
);
}
}
/*!
/*!
...
...
src/boosting/gbdt.cpp
View file @
fca93b78
...
@@ -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
;
random_
=
Random
(
new_config
->
bagging_seed
);
// cannot reset seed, only create one time
if
(
gbdt_config_
==
nullptr
)
{
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
)
{
...
...
src/treelearner/serial_tree_learner.cpp
View file @
fca93b78
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment