Day30 - 模型复杂度分析

在最後一天的内容中,我们会以参数量、乘法数、训练过程中每一个epoch所需的时间测试过程中每一笔资料样本所需的时间来评估静态与动态模型的复杂度。MLP、CNN 及 LSTM-RNN 乘法运算量计算方式如下:

  • MLP: https://chart.googleapis.com/chart?cht=tx&chl=M%5Ctimes%20N
    其中,M 、N 分别表示输入、输出维度。
  • CNN: https://chart.googleapis.com/chart?cht=tx&chl=%24o_%7BH%7D%5Ctimes%20o_%7BW%7D%5Ctimes%20o_%7BC%7D%5Ctimes%20f_%7BW%7D%5Ctimes%20f_%7BH%7D%5Ctimes%20i_%7BC%7D%24
    其中,https://chart.googleapis.com/chart?cht=tx&chl=o_%7BH%7Dhttps://chart.googleapis.com/chart?cht=tx&chl=o_%7BW%7Dhttps://chart.googleapis.com/chart?cht=tx&chl=o_%7BC%7D 分别表示输出特徵图的高、宽与channel 数;https://chart.googleapis.com/chart?cht=tx&chl=f_%7BH%7Dhttps://chart.googleapis.com/chart?cht=tx&chl=f_%7BW%7D 分别表
    示卷积核的高、宽;https://chart.googleapis.com/chart?cht=tx&chl=i_%7BC%7D 则代表输入 channel 数。
  • LSTM-RNN: https://chart.googleapis.com/chart?cht=tx&chl=4%5Ctimes%20(K%2BZ)%5D%5Ctimes%20Z%2B3%5Ctimes%20Z%5E%7B2%7D
    其中,K 、Z 分别表示输入、输出维度。

三种模型的复杂度分析如下:

#hidden layers # parameters # mul. operations training time per epoch test time per data
1 11,705 11,670 1s 0.007s
2 12,635 12,570 1s 0.008s
3 13,565 13,470 1s 0.01s

表1: 静态模型 MLP 复杂度分析

model # parameters # mul. operations training time per epoch test time per data
Basic CNN 24,675 296K 1s 0.014s
Multi-scale CNN 139,805 6.5M 3s 0.035s
Multi-scale CNN with attention 149,405 6.7M 3s 0.045s

表2: 静态模型 CNN 复杂度分析

model # parameters # mul. operations training time per epoch test time per data
LSTM-RNN (last-frame only) 27,389 37,628 423s 0.8s
LSTM-RNN (mean-pooling over time) 27,389 37,628 434s 0.8s
LSTM-RNN with attention 25,675 36,230 215s 0.4s

表3: 动态模型 LSTM-RNN 复杂度分析


这 30 天的语音辨识&语音情绪辨识的旅程就到这边了,感谢大家的阅读&指教,下台一鞠躬!!


<<:  用 Python 畅玩 Line bot - 08:Audio message part2

>>:  Day 27 - Detect Capital

IT 铁人赛 k8s 入门30天 -- day11 Helm - Package Manager

前言 今天要来讲说 Helm 这个工具 因为 Helm 版本会不断推陈出新, 因此在今天的内容着重再...

离职倒数7天:让人感觉自在,不是要说什麽动听的话,而是要把持住不要讲出讨人厌的话

在屋久岛的旅程,最大的惊喜是在第一天的山小屋遇到一个单独登山的大学生 R君 一边做饭闲聊几句後,同行...

高并发下的资料库状态

今天我们要来讨论高并发下的资料库考量 Day03_高并发下的资料库考量 ...

IT铁人DAY 13-Composite 组合模式

  今天要来介绍Composite Pattern,是属於Structural Design Pat...

Day 23-制作购物车之设计SideDrawer&Backdrawer

设计的部分就不多做分析,主要呈现实作成果。 以下内容有参考教学影片,底下有附网址。 (内容包括我的不...