LSTM
一般结构

Forget Gate Layer
Detail
ft=σ(Wf∗[ht−1,xt]+bf)
决定信息保留程度,“1”代表完全保留,“0”代表完全舍弃
Input Gate Layer
Detail
it=σ(Wi∗[ht−1,xt]+bi)
Ct′=tanh(Wi∗[ht−1,xt]+bi)
Next
Ct=ft∗Ct−1+it∗Ct′
Output Gate Layer
Detail
ot=σ(Wo∗[ht−1,xt]+bo)
ht=ot∗tanh(Ct)
一些变形
将Ct−1考虑进来
ft=σ(Wf∗[ht−1,xt,Ct−1]+bf)
it=σ(Wi∗[ht−1,xt,Ct−1]+bi)
ot=σ(Wo∗[ht−1,xt,Ct−1]+bo)
默认it=1−ft
Ct=ft∗Ct−1+(1−ft)∗Ct′

Gated Recurrent Unit(GRU)
特点
- 使用update gate代替forget & input gate
- 合并cell state 和 hidden state
Details

From
http://colah.github.io/posts/2015-08-Understanding-LSTMs/