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
bb05a06f
Commit
bb05a06f
authored
Oct 25, 2016
by
Hui Xue
Browse files
update for typo.
parent
85e90f21
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
15 deletions
+15
-15
src/metric/regression_metric.hpp
src/metric/regression_metric.hpp
+1
-1
src/network/network.cpp
src/network/network.cpp
+2
-2
src/objective/rank_objective.hpp
src/objective/rank_objective.hpp
+1
-1
src/treelearner/feature_histogram.hpp
src/treelearner/feature_histogram.hpp
+3
-3
src/treelearner/leaf_splits.hpp
src/treelearner/leaf_splits.hpp
+2
-2
src/treelearner/parallel_tree_learner.h
src/treelearner/parallel_tree_learner.h
+2
-2
src/treelearner/serial_tree_learner.cpp
src/treelearner/serial_tree_learner.cpp
+3
-3
src/treelearner/serial_tree_learner.h
src/treelearner/serial_tree_learner.h
+1
-1
No files found.
src/metric/regression_metric.hpp
View file @
bb05a06f
...
@@ -65,7 +65,7 @@ public:
...
@@ -65,7 +65,7 @@ public:
}
}
private:
private:
/*! \brief Output frequen
tl
y */
/*! \brief Output frequen
c
y */
int
output_freq_
;
int
output_freq_
;
/*! \brief Number of data */
/*! \brief Number of data */
data_size_t
num_data_
;
data_size_t
num_data_
;
...
...
src/network/network.cpp
View file @
bb05a06f
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
namespace
LightGBM
{
namespace
LightGBM
{
// static member defin
a
tion
// static member defin
i
tion
int
Network
::
num_machines_
;
int
Network
::
num_machines_
;
int
Network
::
rank_
;
int
Network
::
rank_
;
Linkers
*
Network
::
linkers_
;
Linkers
*
Network
::
linkers_
;
...
@@ -141,7 +141,7 @@ void Network::ReduceScatter(char* input, int input_size, int* block_start, int*
...
@@ -141,7 +141,7 @@ void Network::ReduceScatter(char* input, int input_size, int* block_start, int*
// send local data to neighbor first
// send local data to neighbor first
linkers_
->
Send
(
recursive_halving_map_
.
neighbor
,
input
,
input_size
);
linkers_
->
Send
(
recursive_halving_map_
.
neighbor
,
input
,
input_size
);
}
else
if
(
recursive_halving_map_
.
type
==
RecursiveHalvingNodeType
::
GroupLeader
)
{
}
else
if
(
recursive_halving_map_
.
type
==
RecursiveHalvingNodeType
::
GroupLeader
)
{
// rec
i
eve neighbor data first
// rece
i
ve neighbor data first
int
need_recv_cnt
=
input_size
;
int
need_recv_cnt
=
input_size
;
linkers_
->
Recv
(
recursive_halving_map_
.
neighbor
,
output
,
need_recv_cnt
);
linkers_
->
Recv
(
recursive_halving_map_
.
neighbor
,
output
,
need_recv_cnt
);
// reduce
// reduce
...
...
src/objective/rank_objective.hpp
View file @
bb05a06f
...
@@ -50,7 +50,7 @@ public:
...
@@ -50,7 +50,7 @@ public:
Log
::
Stderr
(
"For NDCG metric, should have query information"
);
Log
::
Stderr
(
"For NDCG metric, should have query information"
);
}
}
num_queries_
=
metadata
.
num_queries
();
num_queries_
=
metadata
.
num_queries
();
// cache inverse max DCG, avoid compution many times
// cache inverse max DCG, avoid comput
at
ion many times
inverse_max_dcgs_
=
new
score_t
[
num_queries_
];
inverse_max_dcgs_
=
new
score_t
[
num_queries_
];
for
(
data_size_t
i
=
0
;
i
<
num_queries_
;
++
i
)
{
for
(
data_size_t
i
=
0
;
i
<
num_queries_
;
++
i
)
{
inverse_max_dcgs_
[
i
]
=
static_cast
<
score_t
>
(
inverse_max_dcgs_
[
i
]
=
static_cast
<
score_t
>
(
...
...
src/treelearner/feature_histogram.hpp
View file @
bb05a06f
...
@@ -40,7 +40,7 @@ public:
...
@@ -40,7 +40,7 @@ public:
* \brief Construct a histogram
* \brief Construct a histogram
* \param num_data number of data in current leaf
* \param num_data number of data in current leaf
* \param sum_gradients sum of gradients of current leaf
* \param sum_gradients sum of gradients of current leaf
* \param sum_hessians sum of h
i
ssians of current leaf
* \param sum_hessians sum of h
e
ssians of current leaf
* \param ordered_gradients Orederd gradients
* \param ordered_gradients Orederd gradients
* \param ordered_hessians Ordered hessians
* \param ordered_hessians Ordered hessians
* \param data_indices data indices of current leaf
* \param data_indices data indices of current leaf
...
@@ -59,7 +59,7 @@ public:
...
@@ -59,7 +59,7 @@ public:
* \param leaf current leaf
* \param leaf current leaf
* \param num_data number of data in current leaf
* \param num_data number of data in current leaf
* \param sum_gradients sum of gradients of current leaf
* \param sum_gradients sum of gradients of current leaf
* \param sum_hessians sum of h
i
ssians of current leaf
* \param sum_hessians sum of h
e
ssians of current leaf
* \param gradients
* \param gradients
* \param hessian
* \param hessian
*/
*/
...
@@ -76,7 +76,7 @@ public:
...
@@ -76,7 +76,7 @@ public:
* \brief Set sumup information for current histogram
* \brief Set sumup information for current histogram
* \param num_data number of data in current leaf
* \param num_data number of data in current leaf
* \param sum_gradients sum of gradients of current leaf
* \param sum_gradients sum of gradients of current leaf
* \param sum_hessians sum of h
i
ssians of current leaf
* \param sum_hessians sum of h
e
ssians of current leaf
*/
*/
void
SetSumup
(
data_size_t
num_data
,
score_t
sum_gradients
,
score_t
sum_hessians
)
{
void
SetSumup
(
data_size_t
num_data
,
score_t
sum_gradients
,
score_t
sum_hessians
)
{
num_data_
=
num_data
;
num_data_
=
num_data
;
...
...
src/treelearner/leaf_splits.hpp
View file @
bb05a06f
...
@@ -26,7 +26,7 @@ public:
...
@@ -26,7 +26,7 @@ public:
}
}
/*!
/*!
* \brief Init splits on current leaf, don't need to trave
sal
all data
* \brief Init splits on current leaf, don't need to trave
rse
all data
* \param leaf Index of current leaf
* \param leaf Index of current leaf
* \param data_partition current data partition
* \param data_partition current data partition
* \param sum_gradients
* \param sum_gradients
...
@@ -43,7 +43,7 @@ public:
...
@@ -43,7 +43,7 @@ public:
}
}
/*!
/*!
* \brief Init splits on current leaf, need to trave
sal
all data to sum up
* \brief Init splits on current leaf, need to trave
rse
all data to sum up
* \param gradients
* \param gradients
* \param hessians
* \param hessians
*/
*/
...
...
src/treelearner/parallel_tree_learner.h
View file @
bb05a06f
...
@@ -77,9 +77,9 @@ private:
...
@@ -77,9 +77,9 @@ private:
int
*
block_start_
;
int
*
block_start_
;
/*! \brief Block size for reduce scatter */
/*! \brief Block size for reduce scatter */
int
*
block_len_
;
int
*
block_len_
;
/*! \brief Write positions for feature histgrams */
/*! \brief Write positions for feature hist
o
grams */
int
*
buffer_write_start_pos_
;
int
*
buffer_write_start_pos_
;
/*! \brief Read positions for local feature histgrams */
/*! \brief Read positions for local feature hist
o
grams */
int
*
buffer_read_start_pos_
;
int
*
buffer_read_start_pos_
;
/*! \brief Size for reduce scatter */
/*! \brief Size for reduce scatter */
int
reduce_scatter_size_
;
int
reduce_scatter_size_
;
...
...
src/treelearner/serial_tree_learner.cpp
View file @
bb05a06f
...
@@ -239,16 +239,16 @@ bool SerialTreeLearner::BeforeFindBestSplit(int left_leaf, int right_leaf) {
...
@@ -239,16 +239,16 @@ bool SerialTreeLearner::BeforeFindBestSplit(int left_leaf, int right_leaf) {
larger_leaf_histogram_array_
=
nullptr
;
larger_leaf_histogram_array_
=
nullptr
;
}
else
if
(
num_data_in_left_child
<
num_data_in_right_child
)
{
}
else
if
(
num_data_in_left_child
<
num_data_in_right_child
)
{
smaller_leaf
=
left_leaf
;
smaller_leaf
=
left_leaf
;
// put parent(left) leaf's histograms into larger leaf's histgrams
// put parent(left) leaf's histograms into larger leaf's hist
o
grams
larger_leaf_histogram_array_
=
historical_histogram_array_
[
left_leaf
];
larger_leaf_histogram_array_
=
historical_histogram_array_
[
left_leaf
];
smaller_leaf_histogram_array_
=
historical_histogram_array_
[
right_leaf
];
smaller_leaf_histogram_array_
=
historical_histogram_array_
[
right_leaf
];
// We will construc histograms for smaller leaf, and smaller_leaf=left_leaf = parent.
// We will construc histograms for smaller leaf, and smaller_leaf=left_leaf = parent.
// if we don't swap the cache, we will overwrite the parent's hisogram cache.
// if we don't swap the cache, we will overwrite the parent's his
t
ogram cache.
std
::
swap
(
historical_histogram_array_
[
left_leaf
],
historical_histogram_array_
[
right_leaf
]);
std
::
swap
(
historical_histogram_array_
[
left_leaf
],
historical_histogram_array_
[
right_leaf
]);
}
else
{
}
else
{
smaller_leaf
=
right_leaf
;
smaller_leaf
=
right_leaf
;
// put parent(left) leaf's histograms to larger leaf's histgrams
// put parent(left) leaf's histograms to larger leaf's hist
o
grams
larger_leaf_histogram_array_
=
historical_histogram_array_
[
left_leaf
];
larger_leaf_histogram_array_
=
historical_histogram_array_
[
left_leaf
];
smaller_leaf_histogram_array_
=
historical_histogram_array_
[
right_leaf
];
smaller_leaf_histogram_array_
=
historical_histogram_array_
[
right_leaf
];
}
}
...
...
src/treelearner/serial_tree_learner.h
View file @
bb05a06f
...
@@ -120,7 +120,7 @@ protected:
...
@@ -120,7 +120,7 @@ protected:
DataPartition
*
data_partition_
;
DataPartition
*
data_partition_
;
/*! \brief used for generate used features */
/*! \brief used for generate used features */
Random
random_
;
Random
random_
;
/*! \brief used for sub feature training, is_feature_used_[i] = fal
a
se means don't used feature i */
/*! \brief used for sub feature training, is_feature_used_[i] = false means don't used feature i */
bool
*
is_feature_used_
;
bool
*
is_feature_used_
;
/*! \brief cache historical histogram to speed up */
/*! \brief cache historical histogram to speed up */
FeatureHistogram
**
historical_histogram_array_
;
FeatureHistogram
**
historical_histogram_array_
;
...
...
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