# 序言
框架由学习器和超参数优化器组成。
![PocketFlow压缩流程](https://pocketflow.github.io/pics/framework_design.png "PocketFlow框架")
# 学习器
|压缩方法|论文|
|:--:|:--:|
|ChannelPrunedLearner|lasso回归通道选择[Channel Pruning for Accelerating Very Deep Neural Networks](https://arxiv.org/abs/1707.06168) 残差结构中add/element sum的输入算子都不能裁剪通道,而通道较多的正是这两个算子|
|DisChnPrunedLearner|辨别感知通道裁剪[Discrimination-aware Channel Pruning for Deep Neural Networks](https://arxiv.org/abs/1810.11809)|
|WeightSparseLearner|基于动态裁剪策略的权值稀疏[To Prune, or Not to Prune: Exploring the Efficacy of Pruning for Model Compression](https://arxiv.org/abs/1710.01878)|
|UniformQuantLearner|权值量化`0,Nlevel-1` [Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference](https://arxiv.org/abs/1712.05877)|
|UniformQuantTFLearner|权值量化`0,Nlevel-1`[weight quantization with uniform reconstruction levels and TensorFlow APIs](https://www.tensorflow.org/api_docs/python/tf/quantization/quantize)|
|NonUniformQuantLearner|权值量化`Nlevel/2-1,Nlevel/2`[Deep Compression: Compressing Deep Neural Network with Pruning, Trained Quantization and Huffman Coding.](https://arxiv.org/abs/1510.00149)|
训练过程中,使用知识蒸馏来增强额外loss,用未压缩模型输出作为软标签。
#超参数优化器
[AMC:AMC: AutoML for Model Compression and Acceleration on Mobile Devices
](https://arxiv.org/abs/1802.03494)采用通道修剪和细粒度修剪的自动模型压缩的强化学习
超参数优化器工作流程:
每次迭代,超参数优化器选择超参数值组合,同时学习器生成候选模型进行快速迭代。然后评估候选模型以计算当前超参数设置的奖励函数reward。接着超参数优化器更新自己的模型来改进其对超参数空间的估计。最后多次迭代后获得最佳候选模型和对应的超参数设置,模型再用全数据finetune,来减少精度损失。
使用如下方法选定对于压缩模型重要的参数: