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
e55c8158
Unverified
Commit
e55c8158
authored
Nov 25, 2018
by
Guolin Ke
Committed by
GitHub
Nov 25, 2018
Browse files
fix offset in score_updater.
parent
b01d00aa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/boosting/score_updater.hpp
src/boosting/score_updater.hpp
+4
-4
No files found.
src/boosting/score_updater.hpp
View file @
e55c8158
...
@@ -52,17 +52,17 @@ public:
...
@@ -52,17 +52,17 @@ public:
inline
bool
has_init_score
()
const
{
return
has_init_score_
;
}
inline
bool
has_init_score
()
const
{
return
has_init_score_
;
}
inline
void
AddScore
(
double
val
,
int
cur_tree_id
)
{
inline
void
AddScore
(
double
val
,
int
cur_tree_id
)
{
int64
_t
offset
=
cur_tree_id
*
num_data_
;
const
size
_t
offset
=
static_cast
<
size_t
>
(
num_data_
)
*
cur_tree_id
;
#pragma omp parallel for schedule(static)
#pragma omp parallel for schedule(static)
for
(
int
64_t
i
=
0
;
i
<
num_data_
;
++
i
)
{
for
(
int
i
=
0
;
i
<
num_data_
;
++
i
)
{
score_
[
offset
+
i
]
+=
val
;
score_
[
offset
+
i
]
+=
val
;
}
}
}
}
inline
void
MultiplyScore
(
double
val
,
int
cur_tree_id
)
{
inline
void
MultiplyScore
(
double
val
,
int
cur_tree_id
)
{
int64
_t
offset
=
cur_tree_id
*
num_data_
;
const
size
_t
offset
=
static_cast
<
size_t
>
(
num_data_
)
*
cur_tree_id
;
#pragma omp parallel for schedule(static)
#pragma omp parallel for schedule(static)
for
(
int
64_t
i
=
0
;
i
<
num_data_
;
++
i
)
{
for
(
int
i
=
0
;
i
<
num_data_
;
++
i
)
{
score_
[
offset
+
i
]
*=
val
;
score_
[
offset
+
i
]
*=
val
;
}
}
}
}
...
...
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