New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MRG + 1] Fix gradient boosting overflow and various other float comparison on == #7970
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
06fd1f1
reintroduced isclose() and flake8 fixes to fixes.py
chenhe95 01bce69
changed == 0.0 to isclose(...)
chenhe95 ec58cda
example changes
chenhe95 3e1c5d9
changed back to abs() < epsilon
chenhe95 74daa9b
flake8 convention on file
chenhe95 93eb972
reverted flake8 fixes
chenhe95 aef9739
reverted flake8 fixes (2)
chenhe95 c524142
np.finfo(np.float32).tiny instead of hard coded epsilon 1e-150
chenhe95 b15612c
reverted to 1e-150
chenhe95 0de6133
whats new modified
chenhe95 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of
1e-150
you could usenp.finfo(np.float32).eps
... There is precedent for it hereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. I am not sure. @raghavrv do you have a strong preference for
np.finfo(np.float32).eps
or do you think1e-150
is still fine? I personally prefer1e-150
because the case where this algorithm was failing at was whendenominator
was around1e-309
, so I felt that1e-150
was appropriate since it's about half of 300.It's just that I am kind of worried that those values are too large compared to
1e-150
and I'm not sure if it will cause any rounding errors.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
.tiny
then?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this seems okay!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was suggesting
np.finfo(np.double).tiny
, which is close to e-300 for3264 bitand much less for 64 bit systems...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thing is if your system is 32 bit, denominator - which is the result of
np.sum
- can only be as low as (np.finfo(np.float<arch>).tiny
) IIUC...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually wasn't sure about this, because to the power of -308 seemed a bit too small as well, and it can easily overflow for not very large numerators
Which was originally why I had 1e-150