-
Notifications
You must be signed in to change notification settings - Fork 454
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
there is a problem about the result_scale and result_zero_point? #137
Comments
maybe out paper gives more context. |
@bjacob
The above equation is the basic scheme to calculate the quantized matrix multiplication. Since the input matrices are given,
and
(a) -(b), we can get:
Then,
Since |
The result scale and zero_point are not to be inferred from the inputs scale and zero point, that 's why neither our example code nor paper give formulas for that. There is no formula for that. Instead, the quantization parameters of the result must be given by the user. In a typical quantized neural network application, as in our paper, it is the training process that will record the min-max used for each matrix, including for the result matrix. The quantization and inference process will then use that pre-recorded min-max to quantize the result matrix. |
@bjacob |
I think there is, explore around |
@bjacob hello (1)could you tell me how to get the result scale and zero_point during training process? you said that "The quantization and inference process will then use that pre-recorded min-max to quantize the result matrix." thanks a lot, good luck to you @bjacob |
Redirecting these questions to @skligys who wrote Section 3 of this paper on training and is generally the training expert :-) |
same question,i have trained a quantized model in tf object object API, but when i get the global variables in the ".ckpt", i only found the weight_min/max and the min/max after relu6 (0 /5.9997) ,there is not output min/max of conv ,why? FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/act_quant/min:0 |
that's intentional, quantized inference only operates on fully fused
graphs (conv + biasadd + relu6 fused into a single node), the placement of
minmax info matches that fusion granularity.
See https://arxiv.org/abs/1712.05877 for more explanations.
…On Fri, Nov 30, 2018 at 5:36 AM zyc4me ***@***.***> wrote:
same question,i have trained a quantized model in tf object object API,
but when i get the global variables in the ".ckpt", i only found the
weight_min/max and the min/max after relu6 (0 /5.9997) ,there is not output
min/max of conv ,why?
the name of min/max tensor like that:
FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/act_quant/min:0
FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/act_quant/max:0
FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/act_quant/FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/act_quant/min/biased:0
FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/act_quant/FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/act_quant/min/local_step:0
FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/act_quant/FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/act_quant/max/biased:0
FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/act_quant/FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/act_quant/max/local_step:0
FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_1_depthwise/weights_quant/min:0
FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_1_depthwise/weights_quant/max:0
FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_1_depthwise/act_quant/min:0
FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_1_depthwise/act_quant/max:0
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAE2r0eYczYwTYdbg0OZ2rdB_eZYvu-Vks5u0QowgaJpZM4UWY0X>
.
|
I saw the doc/quantization_example.cc.
there is a problem about the result_scale and result_zero_point?
how to make sure about it ?
you count the real result ,them calculate it ?
but if we all do it every time in the real net work,the speed is lower obviously?
who can help me ,solve the problem ??
The text was updated successfully, but these errors were encountered: