Lecture 13(Preparation):Network Compression

目录

Network Pruning

Knowledge Distillation

Parameter Quantization

Architecture Design

Dynamic Computation


下面介绍五个network compression的技术。这五个技术都是以软体为导向的,在软体上面对network进行压缩,不考虑硬体加速部分。

  • Network Pruning

——类神经网路剪枝(Pruning)与大乐透假说(Lottery Ticket Hypothesis)

Network can be pruned: Networks are typically over-parameterized (there is significant redundant weights or neurons). Prune them!

Network Pruning: 把参数/神经元当做修剪的单位,评估参数/神经元的重要性。步骤如下:

        ① lmportance of a weight: absolute values, life long ...

        lmportance of a neuron: the number of times it wasn't zero on a given data set ......

        ② After pruning, the accuracy will drop (hopefully not too much).

        ③ Fine-tuning on training data for recover.

        ④ Don't prune too much at once, or the network won't recover.

weight pruning v.s. neuron pruning

        把参数或神经元当做修剪的单位,在实作上有很显著的差距。

Why pruning?为什么不直接train一个smaller network,而要先train一个big network再进行剪枝?——lt is widely known that smaller network is more difficult to learn successfully. Lottery Ticket Hypothesis(大乐透假说).

Lottery Ticket Hypothesis:

        大乐透假说在实验上如何证实:

        有个研究对大乐透进行了解构:

大乐透的假说不一定是对的,之前的研究对比小model和大model的时候,设定update的epoch数目是一样的。在下面这个研究中,把小model多update几个epoch,小model的结果就比pruning后的model结果好:

  • Knowledge Distillation

为什么不直接train小的network?理由和Network Pruning一样,直接train一个小的network,结果比根据大的network学习出的小的network的结果差。

Knowledge Distillation:

        Knowledge Distillation为什么会有帮助,一个比较直觉的解释是teacher network会提供给student network额外的资讯。

teacher network不一定是一个单一的巨大的network,也可以是多个network的ensemble:

使用Knowledge Distillation的小技巧:稍微改一下softmax的function,加一个temperature

  • Parameter Quantization

——用比较少的空间储存一个参数

1. Using less bits to represent a value

2. Weight clustering

3. Represent frequent clusters by less bits, represent rare clusters by more bits

例如哈夫曼编码

4. Binary Weights. 可以压缩到只拿一个bit去存一个参数

下面是Binary Network中一个经典方法(Binary Connect)用在三个影像辨识问题上的结果,结果表明用Binary Connect的错误率比正常network的错误率低。一个可能的理由是,Binary Network给了network比较大的限制,所以它不太容易overfitting。

  • Architecture Design

——通过network架构的设计,达到减少参数量的效果

Standard CNN:

Depthwise Separable Convolution:

下面比较Standard CNN和Depthwise Separable Convolution这两者参数量的差异:

  • Dynamic Computation

——network可以自由调整它需要的运算量

怎么让network自由地调整它对运算资源的需求,一个可能的方向是让network自由的调整它的深度:Dynamic Depth

另一个可能的方向是让network自由的决定它的宽度:Dynamic Width

上面两个方向是由人自由的去决定network的宽度和深度,也可以让network根据它任务的复杂程度自行决定它的宽度和深度:

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值