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
27ec9e3b
Unverified
Commit
27ec9e3b
authored
Dec 18, 2019
by
Nikita Titov
Committed by
GitHub
Dec 18, 2019
Browse files
fixed some cpplint issues (#2635)
parent
86ca4845
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
16 deletions
+15
-16
include/LightGBM/utils/text_reader.h
include/LightGBM/utils/text_reader.h
+6
-8
src/io/config.cpp
src/io/config.cpp
+1
-1
src/main.cpp
src/main.cpp
+3
-2
src/metric/multiclass_metric.hpp
src/metric/multiclass_metric.hpp
+4
-4
src/network/linkers.h
src/network/linkers.h
+1
-1
No files found.
include/LightGBM/utils/text_reader.h
View file @
27ec9e3b
...
...
@@ -17,6 +17,8 @@
namespace
LightGBM
{
const
size_t
kGbs
=
size_t
(
1024
)
*
1024
*
1024
;
/*!
* \brief Read text data from file
*/
...
...
@@ -123,10 +125,8 @@ class TextReader {
size_t
prev_bytes_read
=
bytes_read
;
bytes_read
+=
read_cnt
;
if
(
prev_bytes_read
/
read_progress_interval_bytes_
<
bytes_read
/
read_progress_interval_bytes_
)
{
const
size_t
gbs
=
size_t
(
1024
)
*
1024
*
1024
;
Log
::
Debug
(
"Read %.1f GBs from %s."
,
1.0
*
bytes_read
/
gbs
,
filename_
);
if
(
prev_bytes_read
/
read_progress_interval_bytes_
<
bytes_read
/
read_progress_interval_bytes_
)
{
Log
::
Debug
(
"Read %.1f GBs from %s."
,
1.0
*
bytes_read
/
kGbs
,
filename_
);
}
return
cnt
;
...
...
@@ -284,10 +284,8 @@ class TextReader {
size_t
prev_bytes_read
=
bytes_read
;
bytes_read
+=
read_cnt
;
if
(
prev_bytes_read
/
read_progress_interval_bytes_
<
bytes_read
/
read_progress_interval_bytes_
)
{
const
size_t
gbs
=
size_t
(
1024
)
*
1024
*
1024
;
Log
::
Debug
(
"Read %.1f GBs from %s."
,
1.0
*
bytes_read
/
gbs
,
filename_
);
if
(
prev_bytes_read
/
read_progress_interval_bytes_
<
bytes_read
/
read_progress_interval_bytes_
)
{
Log
::
Debug
(
"Read %.1f GBs from %s."
,
1.0
*
bytes_read
/
kGbs
,
filename_
);
}
return
cnt
;
...
...
src/io/config.cpp
View file @
27ec9e3b
...
...
@@ -181,7 +181,7 @@ void Config::GetAucMuWeights() {
}
}
}
}
;
}
void
Config
::
Set
(
const
std
::
unordered_map
<
std
::
string
,
std
::
string
>&
params
)
{
// generate seeds by seed.
...
...
src/main.cpp
View file @
27ec9e3b
...
...
@@ -3,10 +3,11 @@
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#include <LightGBM/application.h>
#include "network/linkers.h"
#include <iostream>
#include "network/linkers.h"
int
main
(
int
argc
,
char
**
argv
)
{
bool
success
=
false
;
try
{
...
...
@@ -38,4 +39,4 @@ int main(int argc, char** argv) {
exit
(
-
1
);
}
}
}
src/metric/multiclass_metric.hpp
View file @
27ec9e3b
...
...
@@ -10,6 +10,7 @@
#include <string>
#include <cmath>
#include <utility>
#include <vector>
namespace
LightGBM
{
...
...
@@ -180,7 +181,7 @@ class MultiSoftmaxLoglossMetric: public MulticlassMetric<MultiSoftmaxLoglossMetr
/*! \brief Auc-mu for multiclass task*/
class
AucMuMetric
:
public
Metric
{
public:
public:
explicit
AucMuMetric
(
const
Config
&
config
)
:
config_
(
config
)
{
num_class_
=
config
.
num_class
;
class_weights_
=
config
.
auc_mu_weights_matrix
;
...
...
@@ -248,8 +249,7 @@ public:
// if scores are equal, put j class first
if
(
std
::
fabs
(
a
.
second
-
b
.
second
)
<
kEpsilon
)
{
return
label_
[
a
.
first
]
>
label_
[
b
.
first
];
}
else
if
(
a
.
second
<
b
.
second
)
{
}
else
if
(
a
.
second
<
b
.
second
)
{
return
true
;
}
else
{
return
false
;
...
...
@@ -293,7 +293,7 @@ public:
return
std
::
vector
<
double
>
(
1
,
ans
);
}
private:
private:
/*! \brief Number of data*/
data_size_t
num_data_
;
/*! \brief Pointer to label*/
...
...
src/network/linkers.h
View file @
27ec9e3b
...
...
@@ -156,7 +156,7 @@ class Linkers {
static
void
MpiAbortIfIsParallel
();
#endif
private:
private:
/*! \brief Rank of local machine */
int
rank_
;
/*! \brief Total number machines */
...
...
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