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

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

模型压缩

(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
http://www.javashuo.com/article/p-qbbrotwh-wr.htmlpython

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

优化推理引擎

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

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/api

L一、L2 Regularization

L1正则化能够产生稀疏权值矩阵,即产生一个稀疏模型,能够用于特征选择
L2正则化能够防止模型过拟合(overfitting);必定程度上,L1也能够防止过拟合
http://www.javashuo.com/article/p-cskvckwl-kn.html网络

卷积层的计算优化

https://blog.csdn.net/qq_32998593/article/details/86177151
卷积层的计算优化 im2col: https://blog.csdn.net/dwyane12138/article/details/78449898
卷积层的计算优化 Winograd:http://www.javashuo.com/article/p-hpvnkqmn-dx.html学习

相关文章
相关标签/搜索