gongyanzh

image-20220410205921015

模型压缩

网络剪枝 Netwrok pruning

剪掉网络中无用的参数。

有意思的图,连接先增加后减少。

image-20220410210312020

  1. train large model
  2. 评估重要性
    1. 参数重要性(以参数为剪枝单位)
      1. 比如根据权重的绝对值
    2. 神经元重要性(以神经元为剪枝单位)
      1. 比如 神经元是否为0
  3. 剪掉不重要的
  4. 微调小模型,重复执行

image-20220410210747978

weights pruning

网络的形状会变得不规则,难以构造模型,GPU加速;虽然可以充0,但是实际网络并没有变小。

image-20220410210953479

neuron pruning

image-20220410211324738

为什么舍本逐末?不直接train小模型

小网络难以训练,为什么?

  • 根据大乐透假说 Lottery Ticket Hypothesis

    可以理解为增加试验次数,样本量等,海选总会有好的;大模型包含了很多小的子模型

image-20220410212058447

调大学习率,也许会得到和大乐透假说不一样的结果。

知识蒸馏 knowledge Distillation

Student Net 拟合Teacher Net 的输出

image-20220410213437984

temperature softmax

使用了平滑的思想

image-20220410214026910

Parameter Quantization

  • 混合精度

  • Weight clustering

    image-20220410215010773

  • 常出现的参数使用更少的bits

    • 如 Huffman encoding

架构设计 architecture design

Depthwise Separable Convolution

image-20220410220448704

1 Depthwise Convolution

image-20220410220507459

  • Filter number = Input channel number
  • Each filter only considers one channel.
  • The filters are

分类:

nlp

技术点:

相关文章: