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
348c2b51
Commit
348c2b51
authored
May 24, 2017
by
Guolin Ke
Browse files
fix a bug in Common::AvoidInf.
parent
2e9c2be5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
include/LightGBM/utils/common.h
include/LightGBM/utils/common.h
+2
-2
No files found.
include/LightGBM/utils/common.h
View file @
348c2b51
...
...
@@ -465,8 +465,8 @@ inline static std::vector<int> VectorSize(const std::vector<std::vector<T>>& dat
inline
static
double
AvoidInf
(
double
x
)
{
if
(
x
>=
std
::
numeric_limits
<
double
>::
max
())
{
return
std
::
numeric_limits
<
double
>::
max
();
}
else
if
(
x
<=
std
::
numeric_limits
<
double
>::
min
())
{
return
std
::
numeric_limits
<
double
>::
min
();
}
else
if
(
x
<=
std
::
numeric_limits
<
double
>::
lowest
())
{
return
std
::
numeric_limits
<
double
>::
lowest
();
}
else
{
return
x
;
}
...
...
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