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
172caee1
Commit
172caee1
authored
Sep 29, 2018
by
Guolin Ke
Committed by
Nikita Titov
Sep 28, 2018
Browse files
fix warnings on Windows (#1711)
parent
f53116af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/boosting/rf.hpp
src/boosting/rf.hpp
+7
-7
No files found.
src/boosting/rf.hpp
View file @
172caee1
...
...
@@ -47,7 +47,7 @@ public:
tmp_grad_
.
resize
(
num_data_
);
tmp_hess_
.
resize
(
num_data_
);
}
tmp_score_
.
resize
(
num_data_
,
0.0
f
);
tmp_score_
.
resize
(
num_data_
,
0.0
);
}
void
ResetConfig
(
const
Config
*
config
)
override
{
...
...
@@ -74,31 +74,31 @@ public:
tmp_grad_
.
resize
(
num_data_
);
tmp_hess_
.
resize
(
num_data_
);
}
tmp_score_
.
resize
(
num_data_
,
0.0
f
);
tmp_score_
.
resize
(
num_data_
,
0.0
);
}
void
GetRFTargets
(
const
Dataset
*
train_data
)
{
auto
label_ptr
=
train_data
->
metadata
().
label
();
std
::
fill
(
hessians_
.
begin
(),
hessians_
.
end
(),
1
);
std
::
fill
(
hessians_
.
begin
(),
hessians_
.
end
(),
1
.0
f
);
if
(
num_tree_per_iteration_
==
1
)
{
OMP_INIT_EX
();
#pragma omp parallel for schedule(static,1)
for
(
data_size_t
i
=
0
;
i
<
train_data
->
num_data
();
++
i
)
{
OMP_LOOP_EX_BEGIN
();
double
label
=
label_ptr
[
i
];
score_t
label
=
label_ptr
[
i
];
gradients_
[
i
]
=
static_cast
<
score_t
>
(
-
label
);
OMP_LOOP_EX_END
();
}
OMP_THROW_EX
();
}
else
{
std
::
fill
(
gradients_
.
begin
(),
gradients_
.
end
(),
0
);
std
::
fill
(
gradients_
.
begin
(),
gradients_
.
end
(),
0
.0
f
);
OMP_INIT_EX
();
#pragma omp parallel for schedule(static,1)
for
(
data_size_t
i
=
0
;
i
<
train_data
->
num_data
();
++
i
)
{
OMP_LOOP_EX_BEGIN
();
double
label
=
label_ptr
[
i
];
gradients_
[
i
+
static_cast
<
int
>
(
label
)
*
num_data_
]
=
-
1
;
score_t
label
=
label_ptr
[
i
];
gradients_
[
i
+
static_cast
<
int
>
(
label
)
*
num_data_
]
=
-
1
.0
f
;
OMP_LOOP_EX_END
();
}
OMP_THROW_EX
();
...
...
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