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
[TFL] Fix unbounded activation clip range. #46991
Closed
WindQAQ
wants to merge
3
commits into
tensorflow:master
from
WindQAQ:fix-unbounded-activation-clip-range
Closed
[TFL] Fix unbounded activation clip range. #46991
WindQAQ
wants to merge
3
commits into
tensorflow:master
from
WindQAQ:fix-unbounded-activation-clip-range
Conversation
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
For floating point with unbounded activation such as relu and none, set max/min to positive/negative infinity in case infinity is clipped. The change only affects floating point as std::numeric_limits<T>::has_infinity is always false for non-floating point.
abattery
reviewed
Feb 8, 2021
abattery
approved these changes
Feb 8, 2021
google-ml-butler
bot
added
kokoro:force-run
Tests on submitted change
ready to pull
PR ready for merge process
labels
Feb 8, 2021
abattery
approved these changes
Feb 8, 2021
google-ml-butler
bot
added
kokoro:force-run
Tests on submitted change
ready to pull
PR ready for merge process
labels
Feb 8, 2021
thaink
approved these changes
Feb 8, 2021
rthadur
added
ready to pull
PR ready for merge process
and removed
ready to pull
PR ready for merge process
labels
Feb 8, 2021
abattery
reviewed
Feb 8, 2021
abattery
approved these changes
Feb 9, 2021
google-ml-butler
bot
added
kokoro:force-run
Tests on submitted change
ready to pull
PR ready for merge process
labels
Feb 9, 2021
thaink
reviewed
Feb 9, 2021
miaout17
approved these changes
Feb 9, 2021
thaink
approved these changes
Feb 9, 2021
This PR will be hold until we can invest to make a thorough investigation about how current ops are handling inf value to ensure there is no compatibility issues. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cla: yes
comp:lite
TF Lite related issues
prtype:bugfix
PR to fix a bug
size:M
CL Change Size: Medium
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.
Fixes #45312. For floating point with unbounded activation such as relu and none, set max/min to positive/negative infinity in case infinity is clipped. The change only affects floating point as
std::numeric_limits<T>::has_infinity
is always false for non-floating point. Doingmin(max(x, -inf), inf)
is safe because positive infinity is larger than all values except itself and NaN and negative infinity is smaller than all values expect itself and NaN. With the change, TFLite is the same with TF for relu and none activation when input is positive or negative infinity.https://www.gnu.org/software/libc/manual/html_node/Infinity-and-NaN.html
https://en.cppreference.com/w/cpp/types/numeric_limits/has_infinity