quantized.pytorch
quantized.pytorch copied to clipboard
Self.weight is not modified to qweight
Hi @eladhoffer @itayhubara, I see that in the quantize.py file, self.weight is left unchanged and qweight is only used to compute gradients. This results in the use of full precision weights for gradient update step (optimizer.step) which acts as error feedback and hence a less accuracy drop. When I add self.weight=qweight to QConv2d class's forward function, I see an accuracy drop of 15-20% for ResNet20 on CIFAR10. Does that mean we need a copy of the full precision weights and full precision weight update step or am I missing something? Any help would be highly appreciated!
Thanks, Aparna