-
Notifications
You must be signed in to change notification settings - Fork 199
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
Does there have to be QuantIdentity as a first layer? #790
Comments
Hi @phixerino, Thanks for your question. The QuantIdentity is merely quantizing a tensor that you put in. In other words, it is calculating the quantization parameters for your input and returns a QuantTensor (if you set Data type should be the same :) |
Thank you, I understand. But why isnt there the |
Currently, when quantizing models using |
I see. So when I want to use QAT I need to put |
Usually, you would want your input to be quantized, so you need to specify |
Thank you, it does help a lot. I'm guessing that the quantized input to the next QuantConv2d layer is done by QuantReLU, because it has Also if I set |
With
So instead I used I'm using 4-bit to quantize my weight and activations, but as in the examples, I'm using 8-bit for the first and last layer. Now when I'm using 8-bit in the QuantIdentity layer, should I still use 8-bits in my first QuantConv2d layer? Sorry for loads of questions, but I really appreciate the answers. |
In fact, it does make a difference. Cmp. this tutorial, especially cell 13 onwards. The results of a Similarly, applying quantization to the range 0-1 vs. 0-255 makes a difference. I'd suggest go with the usual 0-1 range for the input data.
Yes, the No worries :) |
In a few examples (LeNet, CNV) there is QuantIdentity to quantize the input, but in others (ResNet, ImageNet examples) there isnt. So is it beneficial or not? And what data type does then the network expects?
Btw. my aim is to export the network to FINN. Thanks
The text was updated successfully, but these errors were encountered: