LSTM和GRU
LSTM和GRU
LSTM
![](https://github.com/Holy-Shine/MarkdownPhotos/blob/master/LSTM.png?raw=true)
GRU——LSTM的一种变体
比较如图:
GRU节点更新方式:
\[\begin{align}
z_t&=\sigma(x_t\cdot W_z+h_{t-1}\cdot U_z)\\
r_t&=\sigma(x_t\cdot W_r+h_{t-1}\cdot U_r)\\
\widetilde{h}_t&=tanh(x_t\cdot W+(r_t\odot h_{t-1})\cdot U)\\
h_t&=(1-z_t)h_{t-1}+z_t\cdot \widetilde{h}_t
\end{align}
\]
其中:
\(z_t:\)更新门
\(r_t:\)重置门
怕什么真理无穷,进一寸有一寸的欢喜