arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2108.06983cs.CV
收藏

距离感知Quantization

Distance-aware Quantization

Yonsei University(延世大学)

Dohyung kim, Junghyup Lee, Bumsub Ham

摘要:

我们解决了网络量化的问题,即减少权重和/或激活的位宽,以减轻网络架构。量化方法使用舍入函数将全精度值映射到最近的量化值,但此操作不可微分。使用基于梯度的优化器训练量化网络主要有两种方法。首先,直通估计器(STE)用单位函数的零导数替换舍入的零导数,这导致梯度失配问题。其次,软量化器在训练时用连续函数近似舍入,并在测试时利用舍入进行量化。这消除了梯度失配,但导致量化器间隙问题。我们在一个统一的框架内缓解这两个问题。为此,我们介绍了一种新的量化器,被称为距离感知量化器(DAQ),主要由距离感知软舍入(DASR)和温度控制器。为了缓解梯度失配问题,DASR使用内核软argmax近似离散舍入,这是基于我们的见解,即量化可以被公式化为全精度值和量化值之间基于距离的分配问题。该控制器根据输入自适应地调整DASR中的温度参数,解决了量化器间隙问题。在标准基准测试上的实验结果表明,DAQ在各种位宽下的性能明显优于现有技术。

英文摘要:

We address the problem of network quantization, that is, reducing bit-widths of weights and/or activations to lighten network architectures. Quantization methods use a rounding function to map full-precision values to the nearest quantized ones, but this operation is not differentiable. There are mainly two approaches to training quantized networks with gradient-based optimizers. First, a straight-through estimator (STE) replaces the zero derivative of the rounding with that of an identity function, which causes a gradient mismatch problem. Second, soft quantizers approximate the rounding with continuous functions at training time, and exploit the rounding for quantization at test time. This alleviates the gradient mismatch, but causes a quantizer gap problem. We alleviate both problems in a unified framework. To this end, we introduce a novel quantizer, dubbed a distance-aware quantizer (DAQ), that mainly consists of a distance-aware soft rounding (DASR) and a temperature controller. To alleviate the gradient mismatch problem, DASR approximates the discrete rounding with the kernel soft argmax, which is based on our insight that the quantization can be formulated as a distance-based assignment problem between full-precision values and quantized ones. The controller adjusts the temperature parameter in DASR adaptively according to the input, addressing the quantizer gap problem. Experimental results on standard benchmarks show that DAQ outperforms the state of the art significantly for various bit-widths without bells and whistles.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑