这篇论文提出一个后训练技巧,能在二值网络里提前跳过大量累加计算,VGG11在CIFAR-10上最多省86.6%运算,精度损失很小。
该方法利用训练集上累积和的分布,在累加过程中提前预测最终符号。在VGG11应用于CIFAR-10时,最深层卷积可去除86.6%的累加项,精度仅下降0.37个百分点。同时作用于三个最深卷积时,减少全网络25%的算术操作,精度下降1.36个百分点。全程无需重新训练模型参数。
Threshold-Based Early Stopping of Accumulations in Neural Networks with Binary Activation
Binary neural networks are very attractive for constrained deployment, enabling small footprint and low-power inference. For binary activations, the dot products become sign-controlled additions or subtractions, but the number of operations is unchanged. Indeed, every neuron or output channel still accumulates all of its input, even though only the sign will be retained, which is often wasteful. As the accumulation progresses, the running partial sum frequently drifts so far from zero that its final sign becomes highly predictable long before the last term is reached; every contribution evaluated after that point changes the value of the sum but not the final output activation. This paper turns this observation into a post-training early-stopping mechanism. We characterize the behavior of the running accumulations on the training dataset and use this information to predict the final sign as soon as possible. No model parameter is retrained. We count the number of operations under an idealized ordering of weights. On VGG11 applied to the CIFAR-10 dataset, the method removes $86.6\%$ of the accumulation terms of the deepest convolution for a $0.37$-point accuracy drop, and $25\%$ of the full-network arithmetic when used on the three deepest convolutions simultaneously, for a $1.36$-point drop.