1. 程式人生 > >機器學習與深度學習系列連載: 第二部分 深度學習(十四)迴圈神經網路 2(Gated RNN

機器學習與深度學習系列連載: 第二部分 深度學習(十四)迴圈神經網路 2(Gated RNN

迴圈神經網路 2(Gated RNN - LSTM )

simple RNN 具有梯度消失或者梯度爆炸的特點,所以,在實際應用中,帶有門限的RNN模型變種(Gated RNN)起著至關重要的作用,下面我們來進行介紹:

LSTM (Long Short-term Memory )

LSTM 是一個比較難理解的網路架構,有4個輸入(3個Gate),1個輸出 在這裡插入圖片描述

1 LSTM的運算過程

我們以x1,x2,x3 作為輸入,最上面的藍色為儲存資訊,最下面紅色為輸出資訊:

When x2 = 1, add the numbers of x1 into the memory When x2 = -1, reset the memory When x3 = 1, output the number in the memory. 在這裡插入圖片描述

2. LSTM的組成

(1)每一個時間時間點 • Input gate (current cell ma[ers) • Forget (gate 0, forget past) • Output (how much cell is exposed) • New memory cell 在這裡插入圖片描述 (2)輸出 • Final memory cell: • Final hidden state: 在這裡插入圖片描述 (3)結構 在這裡插入圖片描述

本專欄圖片、公式很多來自臺灣大學李弘毅老師、斯坦福大學cs229,斯坦福大學cs231n 、斯坦福大學cs224n課程。在這裡,感謝這些經典課程,向他們致敬!