深度學習模型優化方法總結

深度學習模型優化方法有:
(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學習

相關文章
相關標籤/搜索