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
c315087f
Unverified
Commit
c315087f
authored
Feb 19, 2020
by
Nikita Titov
Committed by
GitHub
Feb 19, 2020
Browse files
fixed cpplint issues (#2771)
parent
9f79e840
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
20 deletions
+18
-20
include/LightGBM/dataset.h
include/LightGBM/dataset.h
+3
-3
src/io/dataset.cpp
src/io/dataset.cpp
+11
-14
src/io/multi_val_dense_bin.hpp
src/io/multi_val_dense_bin.hpp
+2
-1
src/io/multi_val_sparse_bin.hpp
src/io/multi_val_sparse_bin.hpp
+2
-2
No files found.
include/LightGBM/dataset.h
View file @
c315087f
src/io/dataset.cpp
View file @
c315087f
...
...
@@ -639,9 +639,8 @@ TrainingTempState* Dataset::TestMultiThreadingMethod(
auto
overhead_cost
=
row_wise_init_time
+
row_wise_time
+
col_wise_time
;
Log
::
Warning
(
"Auto-choosing col-wise multi-threading, the overhead of testing was "
"%f "
"seconds.
\n
You can set `force_col_wise=true` to remove the "
"overhead."
,
"%f seconds.
\n
"
"You can set `force_col_wise=true` to remove the overhead."
,
overhead_cost
*
1e-3
);
return
colwise_state
.
release
();
}
else
{
...
...
@@ -649,10 +648,9 @@ TrainingTempState* Dataset::TestMultiThreadingMethod(
auto
overhead_cost
=
col_wise_init_time
+
row_wise_time
+
col_wise_time
;
Log
::
Warning
(
"Auto-choosing row-wise multi-threading, the overhead of testing was "
"%f "
"seconds.
\n
You can set `force_row_wise=true` to remove the "
"overhead.
\n
And if memory is not enough, you can set "
"`force_col_wise=true`."
,
"%f seconds.
\n
"
"You can set `force_row_wise=true` to remove the overhead.
\n
"
"And if memory is not enough, you can set `force_col_wise=true`."
,
overhead_cost
*
1e-3
);
if
(
rowwise_state
->
multi_val_bin
->
IsSparse
())
{
Log
::
Debug
(
"Using Sparse Multi-Val Bin"
);
...
...
@@ -1008,7 +1006,6 @@ void Dataset::DumpTextFile(const char* text_filename) {
fclose
(
file
);
}
void
Dataset
::
InitTrain
(
const
std
::
vector
<
int8_t
>&
is_feature_used
,
bool
is_colwise
,
TrainingTempState
*
temp_state
)
const
{
Common
::
FunctionTimer
fun_time
(
"Dataset::InitTrain"
,
global_timer
);
...
...
@@ -1024,7 +1021,7 @@ void Dataset::InitTrain(const std::vector<int8_t>& is_feature_used,
std
::
vector
<
int
>
used_feature_index
;
for
(
int
i
=
0
;
i
<
num_groups_
;
++
i
)
{
int
f_start
=
group_feature_start_
[
i
];
if
(
feature_groups_
[
i
]
->
is_multi_val_
)
{
if
(
feature_groups_
[
i
]
->
is_multi_val_
)
{
for
(
int
j
=
0
;
j
<
feature_groups_
[
i
]
->
num_feature_
;
++
j
)
{
const
auto
dense_rate
=
1.0
-
feature_groups_
[
i
]
->
bin_mappers_
[
j
]
->
sparse_rate
();
...
...
@@ -1089,8 +1086,8 @@ void Dataset::InitTrain(const std::vector<int8_t>& is_feature_used,
temp_state
->
hist_move_src
.
push_back
(
(
new_num_total_bin
-
cur_num_bin
)
*
2
);
temp_state
->
hist_move_dest
.
push_back
(
(
num_total_bin
-
cur_num_bin
)
*
2
);
temp_state
->
hist_move_dest
.
push_back
(
(
num_total_bin
-
cur_num_bin
)
*
2
);
temp_state
->
hist_move_size
.
push_back
(
cur_num_bin
*
2
);
delta
.
push_back
(
num_total_bin
-
new_num_total_bin
);
}
...
...
@@ -1111,8 +1108,8 @@ void Dataset::InitTrain(const std::vector<int8_t>& is_feature_used,
lower_bound
.
push_back
(
num_total_bin
-
cur_num_bin
);
upper_bound
.
push_back
(
num_total_bin
);
temp_state
->
hist_move_src
.
push_back
(
(
new_num_total_bin
-
cur_num_bin
)
*
2
);
temp_state
->
hist_move_src
.
push_back
(
(
new_num_total_bin
-
cur_num_bin
)
*
2
);
temp_state
->
hist_move_dest
.
push_back
((
num_total_bin
-
cur_num_bin
)
*
2
);
temp_state
->
hist_move_size
.
push_back
(
cur_num_bin
*
2
);
delta
.
push_back
(
num_total_bin
-
new_num_total_bin
);
...
...
src/io/multi_val_dense_bin.hpp
View file @
c315087f
...
...
@@ -5,9 +5,10 @@
#ifndef LIGHTGBM_IO_MULTI_VAL_DENSE_BIN_HPP_
#define LIGHTGBM_IO_MULTI_VAL_DENSE_BIN_HPP_
#include <LightGBM/utils/openmp_wrapper.h>
#include <LightGBM/bin.h>
#include <LightGBM/utils/openmp_wrapper.h>
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <vector>
...
...
src/io/multi_val_sparse_bin.hpp
View file @
c315087f
/*!
* Copyright (c) 2020 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for
* license information.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifndef LIGHTGBM_IO_MULTI_VAL_SPARSE_BIN_HPP_
#define LIGHTGBM_IO_MULTI_VAL_SPARSE_BIN_HPP_
...
...
@@ -9,6 +8,7 @@
#include <LightGBM/bin.h>
#include <LightGBM/utils/openmp_wrapper.h>
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <vector>
...
...
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