深度学习模型优化方法总结

深度学习模型优化方法有:
(1)模型压缩:模型权重量化、模型权重稀疏、模型通道剪枝
(2)优化推理引擎:TVM、tensorRT、OpenVINO

模型压缩

(1)quantization:模型权重量化
(2)sparsification:模型权重稀疏
(3)channel pruning:模型通道剪枝

https://www.jiqizhixin.com/articles/2019-08-07-3
https://zhuanlan.zhihu.com/p/77275130
https://blog.csdn.net/shentanyue/article/details/83539359
(4)Distilling:模型蒸馏
先训练好一个大网络,在最后的softmax层使用合适的温度参数T,最后训练得到的概率称为“软目标”。以这个软目标和真实标签作为目标,去训练一个比较小的网络,训练的时候也使用在大模型中确定的温度参数T
https://zhuanlan.zhihu.com/p/39945855
https://www.cnblogs.com/liaohuiqiang/p/9170582.html

weights quantization 和 sparsification 属于非结构化的压缩,需要推理引擎和硬件的优化才能实现推理加速。

优化推理引擎

(1)Intel 的 OpenVINO
(2)NVIDA 的 tensorRT
(3)ARM 的 Tengine:https://github.com/OAID/Tengine
(4)Tencent 针对移动端应用推出 NCNN
(5)TVM
(6)XLA 方案?

Cost Functions

线性回归的均方误差、逻辑回归(即分类问题)的交叉熵
https://blog.csdn.net/wyisfish/article/details/78050225
https://www.tensorflow.org/api_docs/python/tf/keras/losses
https://machinelearningmastery.com/how-to-choose-loss-functions-when-training-deep-learning-neural-networks/

L1、L2 Regularization

L1正则化可以产生稀疏权值矩阵,即产生一个稀疏模型,可以用于特征选择
L2正则化可以防止模型过拟合(overfitting);一定程度上,L1也可以防止过拟合
https://blog.csdn.net/jinping_shi/article/details/52433975

卷积层的计算优化

https://blog.csdn.net/qq_32998593/article/details/86177151
卷积层的计算优化 im2col: https://blog.csdn.net/dwyane12138/article/details/78449898
卷积层的计算优化 Winograd:https://www.cnblogs.com/shine-lee/p/10906535.html

posted @ 2020-02-17 15:54  qccz123456  阅读(4942)  评论(0编辑  收藏  举报