训练中自动剪枝,兼顾精度与计算量,无需预训练。
Complexity-Aware Training of Deep Neural Networks for Optimal Structure Discovery
- 用变分伯努利参数动态控制单元和层的激活,实现联合剪枝。
- 在CIFAR-10/100和ImageNet上,剪枝率更高且测试准确率更优。
- 仅需三个易调参数,理论保证不早停剪枝,适合资源受限场景。
我们提出一种新型算法,可在训练过程中对深度神经网络进行单元和层的联合剪枝,无需预训练模型即可应用。该算法通过三个易于理解与调节的用户参数,在学习精度与剪枝程度之间实现最优权衡,同时平衡层间与单元级剪枝,以及计算复杂度与参数复杂度。我们构建了一个关于网络权重及变分伯努利分布参数的随机优化问题,其中二值随机变量取值为0或1,用于缩放网络的单元与层。最优网络结构即为此优化问题的解。当变分参数收敛至0时,对应结构被永久禁用,从而在训练与推理阶段均节省计算量。关键贡献在于设计了一种将预测精度与剪枝目标相结合的代价函数,能感知计算/参数复杂度,并自动选择大量正则化参数。我们证明该算法收敛至确定性网络的解。通过分析支撑该随机优化算法的常微分方程系统,建立了网络参数动力学的吸引域,进而导出避免过早剪枝的实际条件。在使用ResNet架构的CIFAR-10/100与ImageNet数据集上评估,本方法在剪枝率与测试准确率方面优于仅层或仅单元剪枝,且与需预训练的联合剪枝方法相比也具有竞争力。
原文摘要 · Abstract (English)
We propose a novel algorithm for combined unit and layer pruning of deep neural networks that functions during training and without requiring a pre-trained network to apply. Our algorithm optimally trades-off learning accuracy and pruning levels while balancing layer vs. unit pruning and computational vs. parameter complexity using only three user-defined parameters, which are easy to interpret and tune. We formulate a stochastic optimization problem over the network weights and the parameters of variational Bernoulli distributions for binary Random Variables taking values either 0 or 1 and scaling the units and layers of the network. Optimal network structures are found as the solution to this optimization problem. Pruning occurs when a variational parameter converges to 0 rendering the corresponding structure permanently inactive, thus saving computations both during training and prediction. A key contribution of our approach is to define a cost function that combines the objectives of prediction accuracy and network pruning in a computational/parameter complexity-aware manner and the automatic selection of the many regularization parameters. We show that the proposed algorithm converges to solutions of the optimization problem corresponding to deterministic networks. We analyze the ODE system that underlies our stochastic optimization algorithm and establish domains of attraction for the dynamics of the network parameters. These theoretical results lead to practical pruning conditions avoiding the premature pruning of units and layers during training. We evaluate our method on the CIFAR-10/100 and ImageNet datasets using ResNet architectures and demonstrate that it gives improved results with respect to pruning ratios and test accuracy over layer-only or unit-only pruning and favorably competes with combined unit and layer pruning algorithms requiring pre-trained networks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。