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
add non-stochastic inference mode to quantizers #25
add non-stochastic inference mode to quantizers #25
Conversation
Merge with head
PiperOrigin-RevId: 293813781 Change-Id: Id4539ccc5b3e252c08b7df67b94bea04d2dd0382
remove QActivation and kernel/bias_quantizer check. PiperOrigin-RevId: 294296495 Change-Id: I1aa49fba7850c63f00c8b905cf448540aa3789d8
PiperOrigin-RevId: 294987571 Change-Id: I63d548bc9516ef595e40d6e736e6eb48e39689ea
PiperOrigin-RevId: 295783821 Change-Id: I0c541eaabe348ca5d9422be18d3877ef1206ce6d
…elu_po2. PiperOrigin-RevId: 296483972 Change-Id: Ia9aa5e652496c8cb4869bf964afd2c163649f01c
PiperOrigin-RevId: 296515539 Change-Id: I0c3d84919459141a2725ada025c74d5a176d5dc3
PiperOrigin-RevId: 297473595 Change-Id: I300a5d241523d0ea09f4d2004e64f94dde6748d3
PiperOrigin-RevId: 299386814 Change-Id: I6208f7a03b4d9a2863116cfa1b0b024a3893d070
- Add alpha, get_scale function for binary and ternary quantizers. - Control the initial weight distribution with respect to fan-in of layers. PiperOrigin-RevId: 302736657 Change-Id: I296d8fe267f9fb47e45ad3bdddac1d7a332c155c
Enhance initialize in qlayer.py. PiperOrigin-RevId: 305970234 Change-Id: I5ad84a632ce0be6108ba13b8c554be4cbe34b038
add qtools/qenergy: for qkeras energy and power estimations. PiperOrigin-RevId: 308871576 Change-Id: I287298f74938f5709ad78a5523cabde94e5ad166
PiperOrigin-RevId: 309327349 Change-Id: Iabf1d6ce09bc898d1fe1a419009e7bf4ea303d02
…Changing this temporarily until other platforms are fixed. PiperOrigin-RevId: 310066976 Change-Id: I0819268839c0a0bcb2e7e1867ca749752e1accfe
PiperOrigin-RevId: 310412069 Change-Id: I81f83c0d7b033cdc3ad8ce5e0f51c60497a52587
PiperOrigin-RevId: 314435784 Change-Id: Ic9b1dc650ce1efdd159a0715461bac7a66c5fa0a
PiperOrigin-RevId: 314828141 Change-Id: I03fdd6830f88b2ba31b5fb5f54c6c3ced39d8827
Hey @jecorona97 The error is "referenced before assignment"
|
when x == const != 0, std = 0.0, x/std = inf PiperOrigin-RevId: 315036769 Change-Id: I6e48443fd7227270f9ef6e51fee1d7f36c3e1cf1
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
1 similar comment
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
52ba950
to
a8e62f0
Compare
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
1 similar comment
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
Hi Jose,
|
- base_quantizer class with is_training attribute and setter method - function call inside layers to pass training information to quantizers ({qconvolutional, qlayers, qnormalization}.py) - unit tests for stochastic quantizers inference mode behavior Modified: - stochastic_{ternary, binary} now inherit from their non stochastic counterparts to delegate inference mode computaiton - Order of quantizer definition to perfom inheritance
…o the base class explicitly
….Activation does not have it - set the proper learning_phase in qactivation_test
…ng arguments - Set proper learning phase inside tests
- Fixed multiple instance of tensorflow conditionals in quantizers.py - Changed stochastic_ternary test to remove the 0 variance cases
- reimported qtools inside init
- Removed unused backend import
- Removed unnecessary logical_and
f1975c7
to
fa86b45
Compare
Currently, models with stochastic quantizers peform stochastic operations even in inference mode. This mechanism prevents this and uses the non-stochastic version of the quantizer if in inference mode.