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
1be76baf
Commit
1be76baf
authored
Dec 05, 2016
by
Guolin Ke
Browse files
update omp_set_num_threads in c_api
parent
7bacf5f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
src/c_api.cpp
src/c_api.cpp
+6
-0
No files found.
src/c_api.cpp
View file @
1be76baf
...
...
@@ -32,6 +32,9 @@ public:
const
char
*
parameters
)
{
auto
param
=
ConfigBase
::
Str2Map
(
parameters
);
config_
.
Set
(
param
);
if
(
config_
.
num_threads
>
0
)
{
omp_set_num_threads
(
config_
.
num_threads
);
}
// create boosting
if
(
config_
.
io_config
.
input_model
.
size
()
>
0
)
{
Log
::
Warning
(
"continued train from model is not support for c_api, \
...
...
@@ -72,6 +75,9 @@ public:
Log
::
Fatal
(
"cannot change boosting_type during training"
);
}
config_
.
Set
(
param
);
if
(
config_
.
num_threads
>
0
)
{
omp_set_num_threads
(
config_
.
num_threads
);
}
if
(
param
.
size
()
==
1
&&
(
param
.
count
(
"learning_rate"
)
||
param
.
count
(
"shrinkage_rate"
)))
{
// only need to set learning rate
boosting_
->
ResetShrinkageRate
(
config_
.
boosting_config
.
learning_rate
);
...
...
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