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
7517eefa
Commit
7517eefa
authored
May 29, 2017
by
Guolin Ke
Browse files
better reproducible across different compilers.
parent
deaa5cda
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/treelearner/serial_tree_learner.cpp
src/treelearner/serial_tree_learner.cpp
+6
-6
No files found.
src/treelearner/serial_tree_learner.cpp
View file @
7517eefa
...
@@ -484,15 +484,15 @@ void SerialTreeLearner::FindBestThresholds() {
...
@@ -484,15 +484,15 @@ void SerialTreeLearner::FindBestThresholds() {
smaller_leaf_splits_
->
sum_gradients
(),
smaller_leaf_splits_
->
sum_hessians
(),
smaller_leaf_splits_
->
sum_gradients
(),
smaller_leaf_splits_
->
sum_hessians
(),
smaller_leaf_splits_
->
num_data_in_leaf
(),
smaller_leaf_splits_
->
num_data_in_leaf
(),
smaller_leaf_histogram_array_
[
feature_index
].
RawData
());
smaller_leaf_histogram_array_
[
feature_index
].
RawData
());
int
real_fidx
=
train_data_
->
RealFeatureIndex
(
feature_index
);
smaller_leaf_histogram_array_
[
feature_index
].
FindBestThreshold
(
smaller_leaf_histogram_array_
[
feature_index
].
FindBestThreshold
(
smaller_leaf_splits_
->
sum_gradients
(),
smaller_leaf_splits_
->
sum_gradients
(),
smaller_leaf_splits_
->
sum_hessians
(),
smaller_leaf_splits_
->
sum_hessians
(),
smaller_leaf_splits_
->
num_data_in_leaf
(),
smaller_leaf_splits_
->
num_data_in_leaf
(),
&
smaller_split
);
&
smaller_split
);
if
(
smaller_split
.
gain
>
smaller_best
[
tid
].
gain
)
{
smaller_split
.
feature
=
real_fidx
;
if
(
smaller_split
>
smaller_best
[
tid
])
{
smaller_best
[
tid
]
=
smaller_split
;
smaller_best
[
tid
]
=
smaller_split
;
smaller_best
[
tid
].
feature
=
train_data_
->
RealFeatureIndex
(
feature_index
);
}
}
// only has root leaf
// only has root leaf
if
(
larger_leaf_splits_
==
nullptr
||
larger_leaf_splits_
->
LeafIndex
()
<
0
)
{
continue
;
}
if
(
larger_leaf_splits_
==
nullptr
||
larger_leaf_splits_
->
LeafIndex
()
<
0
)
{
continue
;
}
...
@@ -511,9 +511,9 @@ void SerialTreeLearner::FindBestThresholds() {
...
@@ -511,9 +511,9 @@ void SerialTreeLearner::FindBestThresholds() {
larger_leaf_splits_
->
sum_hessians
(),
larger_leaf_splits_
->
sum_hessians
(),
larger_leaf_splits_
->
num_data_in_leaf
(),
larger_leaf_splits_
->
num_data_in_leaf
(),
&
larger_split
);
&
larger_split
);
if
(
larger_split
.
gain
>
larger_best
[
tid
].
gain
)
{
larger_split
.
feature
=
real_fidx
;
if
(
larger_split
>
larger_best
[
tid
])
{
larger_best
[
tid
]
=
larger_split
;
larger_best
[
tid
]
=
larger_split
;
larger_best
[
tid
].
feature
=
train_data_
->
RealFeatureIndex
(
feature_index
);
}
}
OMP_LOOP_EX_END
();
OMP_LOOP_EX_END
();
}
}
...
...
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