剪枝系列2:MetaPruning

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的网络,也会剪输入输出层,不仅仅中间层。

实验结果

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值