Closed TaooCAI closed 1 year ago
I fix it, you can try it again, https://github.com/ZouJiu1/LSQplus/blob/master/quantization/lsqplus_quantize_V1.py#L210-L238
Thanks. One more question. Here why we need to multiply g
twice, one for (quant_input - input)**2
and one for grad_alpha
? I found that it is bad if we use(child.quant_input - child.input) * grad_alpha
these two lines, g can be removed or keeped, it will balance or slow down the learning_rate of those params. https://github.com/ZouJiu1/LSQplus/blob/master/quantization/lsqplus_quantize_V1.py#L229-L230