arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2104.00903cs.CV
收藏

基于逐元素梯度缩放的网络Quantization

Network Quantization with Element-wise Gradient Scaling

Yonsei University(延世大学)

Junghyup Lee, Dohyung Kim, Bumsub Ham

摘要:

网络量化旨在减少权重和/或激活的位宽,这对于用有限的硬件资源实现深度神经网络特别重要。大多数方法使用直通估计器(STE)来训练量化网络,这通过替换离散化器的导数(即,圆函数)与恒等函数的圆函数。虽然利用STE的量化网络已经显示出不错的性能,但STE是次优的,因为它简单地传播相同的梯度,而不考虑离散化器的输入和输出之间的离散化误差。在本文中,我们提出了一种逐元素梯度缩放(EWGS),这是一种简单而有效的STE替代方案,在稳定性和准确性方面训练量化网络优于STE。给定离散化器输出的梯度,EWGS自适应地放大或缩小每个梯度元素,并使用缩放的梯度作为离散化器输入的梯度,以通过反向传播训练量化网络。根据每个梯度元素的符号以及离散化器的连续输入和离散输出之间的误差来执行缩放。利用网络的Hessian信息自适应地调整比例因子。我们在图像分类数据集上展示了广泛的实验结果,包括CIFAR-10和ImageNet,在各种位宽设置下具有不同的网络架构,证明了我们方法的有效性。

英文摘要:

Network quantization aims at reducing bit-widths of weights and/or activations, particularly important for implementing deep neural networks with limited hardware resources. Most methods use the straight-through estimator (STE) to train quantized networks, which avoids a zero-gradient problem by replacing a derivative of a discretizer (i.e., a round function) with that of an identity function. Although quantized networks exploiting the STE have shown decent performance, the STE is sub-optimal in that it simply propagates the same gradient without considering discretization errors between inputs and outputs of the discretizer. In this paper, we propose an element-wise gradient scaling (EWGS), a simple yet effective alternative to the STE, training a quantized network better than the STE in terms of stability and accuracy. Given a gradient of the discretizer output, EWGS adaptively scales up or down each gradient element, and uses the scaled gradient as the one for the discretizer input to train quantized networks via backpropagation. The scaling is performed depending on both the sign of each gradient element and an error between the continuous input and discrete output of the discretizer. We adjust a scaling factor adaptively using Hessian information of a network. We show extensive experimental results on the image classification datasets, including CIFAR-10 and ImageNet, with diverse network architectures under a wide range of bit-width settings, demonstrating the effectiveness of our method.

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

↑