iT邦幫忙

2021 iThome 鐵人賽

DAY 30
1
AI & Data

機器學習應用於語音相關服務系列 第 30

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 天的語音辨識&語音情緒辨識的旅程就到這邊了,感謝大家的閱讀&指教,下台一鞠躬!!


上一篇
Day29 - 集成學習 (ensemble learning) part2
系列文
機器學習應用於語音相關服務30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 則留言

0
yuanshang
iT邦新手 4 級 ‧ 2021-10-13 09:26:26

棒棒棒,繼續發展更可跨領域多做一些東西。。。

我要留言

立即登入留言