MetaPruning
MetaPruning:Meta Learning for Automatic Neural Network Channel Pruning
代码:https://github.com/liuzechun/MetaPruning.
论文贡献
1、把元学习(meta learning)用到channel pruning上。
2、不需要人工的参数设计。
3、相比AutoML方法,不需要设计强化学习用到的超参数
论文方法
论文1指出,网络结构才是重要的,卷积核的权重并没有那么重要。因此剪枝重要的是找到合适的网络结构,即每一层的通道数。
本文用提出用PruningNet(一种meta network)来预测网络的通道数和卷积核参数。方法主要有两个阶段。
stage 1: PruningNet training
PruningNet实际上是一个两层全连接层网络。输入为Network Encoding Vector,即每层通道数向量,输出为卷积核参数。reshape后等于建立了一个卷积神经网络。训练时, 不更新Pruned Network的weights,而是更新PruningNet的参数。
为了训练PruningNet,作者提出了随机结构采样(stochastic structure sampling)。训练时随机选择Network encoding vector。不同的Network encoding vector 会产生不同的weights。通过随机训练不同的encoding vector,PruningNet学习到怎么产生合理的weights。
By stochastically training with different encoding vectors, the PruningNet learns to predict reasonable weights for various different Pruned Networks.
stage 2: Pruned-Network search
PruningNet训练完成后,可以对不同的Network Encoding Vector进行精度测试,找到最好的Network Encoding Vector。但是vector选择空间巨大,不可能一一遍历,所以使用进化算法evolutionary search
we first randomly select a number of genes and obtain the accuracy of the corresponding pruned network by doing the evaluation. Then the top k genes with highest accuracy are selected for generating the new genes with mutation and crossover.
取好的genes(Network Encoding Vector)组合得到更好的genes.
论文实验
实验设置
第一阶段训练PruningNet用到的数据集是ImageNet挑出来的,没有用全部图片。
另外注意一下对resnet这种有shortcut的网络,也会剪输入输出层,不仅仅中间层。
实验结果
略