Commit ed599510 by 姜雨帆

update lstm&gru

parent fcb2aa20
...@@ -1565,15 +1565,15 @@ NLP问题的隐含结构假设 & 无隐含结构假设,端到端学习 \\ ...@@ -1565,15 +1565,15 @@ NLP问题的隐含结构假设 & 无隐含结构假设,端到端学习 \\
\end{scope} \end{scope}
\begin{scope} \begin{scope}
\node[wordnode,anchor=south] () at ([xshift=0.5\base]aux21) {$h_t$}; \node[wordnode,anchor=south] () at ([xshift=0.5\base]aux21) {$h_{t-1}$};
\node[wordnode,anchor=west] () at (aux12) {$x_t$}; \node[wordnode,anchor=west] () at (aux12) {$x_t$};
\node[wordnode,anchor=south] () at ([xshift=0.5\base]aux51) {$c_t$}; \node[wordnode,anchor=south] () at ([xshift=0.5\base]aux51) {$c_{t-1}$};
\visible<3->{ \visible<3->{
\node[wordnode,anchor=south] () at ([xshift=-0.5\base]aux59) {$c_{t+1}$}; \node[wordnode,anchor=south] () at ([xshift=-0.5\base]aux59) {$c_{t}$};
} }
\visible<4->{ \visible<4->{
\node[wordnode,anchor=east] () at (aux68) {$h_{t+1}$}; \node[wordnode,anchor=east] () at (aux68) {$h_{t}$};
\node[wordnode,anchor=south] () at ([xshift=-0.5\base]aux29) {$h_{t+1}$}; \node[wordnode,anchor=south] () at ([xshift=-0.5\base]aux29) {$h_{t}$};
} }
\end{scope} \end{scope}
...@@ -1584,27 +1584,27 @@ NLP问题的隐含结构假设 & 无隐含结构假设,端到端学习 \\ ...@@ -1584,27 +1584,27 @@ NLP问题的隐含结构假设 & 无隐含结构假设,端到端学习 \\
\begin{scope} \begin{scope}
\visible<1->{ \visible<1->{
% forget gate formula % forget gate formula
\node[formulanode,anchor=south east,text width=3.4cm] () at ([shift={(4\base,1.5\base)}]aux51) {遗忘门\\$f_t=\sigma(W_f[h_t,x_t]+b_f)$}; \node[formulanode,anchor=south east,text width=3.4cm] () at ([shift={(4\base,1.5\base)}]aux51) {遗忘门\\$f_t=\sigma(W_f[h_{t-1},x_t]+b_f)$};
} }
\visible<2->{ \visible<2->{
% input gate formula % input gate formula
\node[formulanode,anchor=north east] () at ([shift={(4\base,-1.5\base)}]aux21) {输入门\\$i_t=\sigma(W_i[h_t,x_t]+b_i)$\\$\hat{c}_t=\mathrm{tanh}(W_c[h_t,x_t]+b_c)$}; \node[formulanode,anchor=north east] () at ([shift={(4\base,-1.5\base)}]aux21) {输入门\\$i_t=\sigma(W_i[h_{t-1},x_t]+b_i)$\\$\hat{c}_t=\mathrm{tanh}(W_c[h_{t-1},x_t]+b_c)$};
} }
\visible<3->{ \visible<3->{
% cell update formula % cell update formula
\node[formulanode,anchor=south west,text width=3.02cm] () at ([shift={(-4\base,1.5\base)}]aux59) {记忆更新\\$c_{t+1}=f_t\cdot c_t+i_t\cdot \hat{c}_t$}; \node[formulanode,anchor=south west,text width=3.02cm] () at ([shift={(-4\base,1.5\base)}]aux59) {记忆更新\\$c_{t}=f_t\cdot c_{t-1}+i_t\cdot \hat{c}_t$};
} }
\visible<4->{ \visible<4->{
% output gate formula % output gate formula
\node[formulanode,anchor=north west] () at ([shift={(-4\base,-1.5\base)}]aux29) {输出门\\$o_t=\sigma(W_o[h_t,x_t]+b_o)$\\$h_{t+1}=o_t\cdot \mathrm{tanh}(c_{t+1})$}; \node[formulanode,anchor=north west] () at ([shift={(-4\base,-1.5\base)}]aux29) {输出门\\$o_t=\sigma(W_o[h_{t-1},x_t]+b_o)$\\$h_{t}=o_t\cdot \mathrm{tanh}(c_{t})$};
} }
\end{scope} \end{scope}
\end{tikzpicture} \end{tikzpicture}
\end{center} \end{center}
{\scriptsize\begin{tabular}{l} {\scriptsize\begin{tabular}{l}
*$x_t$: 前一层的输出,$h_t$: 同一层上一时刻的隐藏状态\\ *$x_t$: 上一层的输出,$h_{t-1}$: 同一层上一时刻的隐藏状态\\
*$c_t$: 同一层上一时刻的记忆 *$c_{t-1}$: 同一层上一时刻的记忆
\end{tabular}} \end{tabular}}
\end{frame} \end{frame}
...@@ -1735,11 +1735,11 @@ NLP问题的隐含结构假设 & 无隐含结构假设,端到端学习 \\ ...@@ -1735,11 +1735,11 @@ NLP问题的隐含结构假设 & 无隐含结构假设,端到端学习 \\
\end{scope} \end{scope}
\begin{scope} \begin{scope}
\node[wordnode,anchor=south] () at (aux71) {$h_t$}; \node[wordnode,anchor=south] () at (aux71) {$h_{t-1}$};
\node[wordnode,anchor=west] () at (aux12) {$x_t$}; \node[wordnode,anchor=west] () at (aux12) {$x_t$};
\visible<3->{ \visible<3->{
\node[wordnode,anchor=east] () at (aux87) {$h_{t+1}$}; \node[wordnode,anchor=east] () at (aux87) {$h_{t}$};
\node[wordnode,anchor=south] () at (aux78) {$h_{t+1}$}; \node[wordnode,anchor=south] () at (aux78) {$h_{t}$};
} }
\end{scope} \end{scope}
...@@ -1750,15 +1750,15 @@ NLP问题的隐含结构假设 & 无隐含结构假设,端到端学习 \\ ...@@ -1750,15 +1750,15 @@ NLP问题的隐含结构假设 & 无隐含结构假设,端到端学习 \\
\begin{scope} \begin{scope}
\visible<1->{ \visible<1->{
% reset gate formula % reset gate formula
\node[formulanode,anchor=west,text width=4cm] (reset) at ([shift={(\base,0.7\base)}]aux78) {重置门\\$r_t=\sigma(W_r[h_t,x_t])$}; \node[formulanode,anchor=west,text width=4cm] (reset) at ([shift={(\base,0.7\base)}]aux78) {重置门\\$r_t=\sigma(W_r[h_{t-1},x_t])$};
} }
\visible<2->{ \visible<2->{
% update gate formula % update gate formula
\node[formulanode,anchor=north west,text width=4cm] (update) at ([yshift=-0.5\base]reset.south west) {更新门\\$u_t=\sigma(W_u[h_t,x_t])$}; \node[formulanode,anchor=north west,text width=4cm] (update) at ([yshift=-0.5\base]reset.south west) {更新门\\$u_t=\sigma(W_u[h_{t-1},x_t])$};
} }
\visible<3->{ \visible<3->{
% hidden update formula % hidden update formula
\node[formulanode,anchor=north west,text width=4cm] () at ([yshift=-0.5\base]update.south west) {隐藏状态更新\\$\hat{h}_t=\mathrm{tanh}(W[r_t\cdot h_t,x_t])$\\$h_{t+1}=(1-u_t)\cdot h_t+u_t\cdot \hat{h}_t$}; \node[formulanode,anchor=north west,text width=4cm] () at ([yshift=-0.5\base]update.south west) {隐藏状态更新\\$\hat{h}_t=\mathrm{tanh}(W[r_t\cdot h_{t-1},x_t])$\\$h_{t}=(1-u_t)\cdot h_{t-1}+u_t\cdot \hat{h}_t$};
} }
\end{scope} \end{scope}
\end{tikzpicture} \end{tikzpicture}
...@@ -1766,7 +1766,7 @@ NLP问题的隐含结构假设 & 无隐含结构假设,端到端学习 \\ ...@@ -1766,7 +1766,7 @@ NLP问题的隐含结构假设 & 无隐含结构假设,端到端学习 \\
{\footnotesize\begin{tabular}{l} {\footnotesize\begin{tabular}{l}
*$x_t$: 上一层的输出\\ *$x_t$: 上一层的输出\\
*$h_t$: 同一层上一时刻的隐藏状态 *$h_{t-1}$: 同一层上一时刻的隐藏状态
\end{tabular}} \end{tabular}}
\end{frame} \end{frame}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论