Commit 9c3891b4 by Lee

Update LSTM

parent d99ecb4b
......@@ -22,6 +22,7 @@
\usepackage{esvect}
\usepackage{CJKulem}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
......@@ -1155,12 +1156,108 @@ NLP问题的隐含结构假设 & 无隐含结构假设,端到端学习 \\
%%% 图
\begin{center}
\begin{tikzpicture}
\setlength{\base}{1cm}
\tikzstyle{wordnode} = [font=\normalsize,align=left]
\tikzstyle{auxnode} = [inner sep=0pt,outer sep=0pt,opacity=50,draw=red,fill=red,circle,minimum size=3pt]
\tikzstyle{auxnode} = [inner sep=0pt,outer sep=0pt,opacity=0,draw=red,fill=red,circle,minimum size=3pt]
\tikzstyle{opnode} = [inner sep=0pt,outer sep=0pt,fill=white,font=\normalsize]
\tikzstyle{standard} = [rounded corners=5pt]
\tikzstyle{emph} = [rounded corners=5pt,very thick,draw=red]
% Skeleton
\begin{scope}[every label/.append style={label distance=1pt,font=\tiny,inner sep=0pt,opacity=0}]
\coordinate (aux12) at (0,0);
\node[auxnode,label={-45:12}] () at (aux12) {};
\coordinate (aux22) at ([yshift=\base]aux12);
\node[auxnode,label={-45:22}] () at (aux22) {};
\coordinate (aux21) at ([xshift=-\base]aux22);
\node[auxnode,label={-45:21}] () at (aux21) {};
\coordinate (aux23) at ([xshift=\base]aux22);
\node[auxnode,label={-45:23}] () at (aux23) {};
\coordinate (aux24) at ([xshift=\base]aux23);
\node[auxnode,label={-45:24}] () at (aux24) {};
\coordinate (aux25) at ([xshift=\base]aux24);
\node[auxnode,label={-45:25}] () at (aux25) {};
\coordinate (aux26) at ([xshift=\base]aux25);
\node[auxnode,label={-45:26}] () at (aux26) {};
\coordinate (aux27) at ([xshift=\base]aux26);
\node[auxnode,label={-45:27}] () at (aux27) {};
\coordinate (aux28) at ([xshift=\base]aux27);
\node[auxnode,label={-45:28}] () at (aux28) {};
\coordinate (aux29) at ([xshift=\base]aux28);
\node[auxnode,label={-45:29}] () at (aux29) {};
\coordinate (aux33) at ([yshift=\base]aux23);
\node[auxnode,label={-45:33}] () at (aux33) {};
\coordinate (aux34) at ([yshift=\base]aux24);
\node[auxnode,label={-45:34}] () at (aux34) {};
\coordinate (aux35) at ([yshift=\base]aux25);
\node[auxnode,label={-45:35}] () at (aux35) {};
\coordinate (aux37) at ([yshift=\base]aux27);
\node[auxnode,label={-45:37}] () at (aux37) {};
\coordinate (aux45) at ([yshift=\base]aux35);
\node[auxnode,label={-45:45}] () at (aux45) {};
\coordinate (aux55) at ([yshift=\base]aux45);
\node[auxnode,label={-45:55}] () at (aux55) {};
\ExtractX{$(aux21)$}
\ExtractY{$(aux55)$}
\coordinate (aux51) at (\XCoord,\YCoord);
\node[auxnode,label={-45:51}] () at (aux51) {};
\ExtractX{$(aux23)$}
\ExtractY{$(aux55)$}
\coordinate (aux53) at (\XCoord,\YCoord);
\node[auxnode,label={-45:53}] () at (aux53) {};
\ExtractX{$(aux28)$}
\ExtractY{$(aux55)$}
\coordinate (aux58) at (\XCoord,\YCoord);
\node[auxnode,label={-45:58}] () at (aux58) {};
\ExtractX{$(aux29)$}
\ExtractY{$(aux55)$}
\coordinate (aux59) at (\XCoord,\YCoord);
\node[auxnode,label={-45:59}] () at (aux59) {};
\coordinate (aux68) at ([yshift=\base]aux58);
\node[auxnode,label={-45:68}] () at (aux68) {};
\end{scope}
\begin{scope}
\node[auxnode,label={[label distance=1pt,font=\tiny,inner sep=0pt]-45:00}] (aux00) at (0,0) {};
\node[opnode] (f53) at (aux53) {$\bigotimes$};
\node[opnode] (u55) at (aux55) {$\bigoplus$};
% forget gate
\draw[standard] (aux21) -- (aux23) -- (aux33);
\draw[-latex,standard] (aux12) -- (aux22) -- (aux23) -- (f53);
\node[opnode] () at (aux33) {$\bigodot$};
% input gate
\node[opnode] (i45) at (aux45) {$\bigotimes$};
\draw[-latex,standard] (aux21) -- (aux24) |- (i45);
\draw[-latex,standard] (aux21) -- (aux25) -- (u55);
\node[opnode] () at (aux34) {$\bigodot$};
\node[opnode,draw,rectangle,rounded corners=2pt,inner sep=3pt,font=\small] () at (aux35) {$\mathrm{tanh}$};
\node[opnode] (i45) at (aux45) {$\bigotimes$};
% cell update
\draw[-latex,standard] (aux51) -- (aux59);
\node[opnode] (f53) at (aux53) {$\bigotimes$};
\node[opnode] (u55) at (aux55) {$\bigoplus$};
% output gate
\node[opnode] (o27) at (aux27) {$\bigotimes$};
\draw[-latex,standard] (u55) -| (o27);
\draw[-latex,standard] (aux21) -- (o27);
\node[opnode] () at (aux26) {$\bigodot$};
\node[opnode,draw,rectangle,rounded corners=2pt,inner sep=3pt,font=\small] () at (aux37) {$\mathrm{tanh}$};
\draw[-latex,standard] (o27) -- (aux29);
\draw[-latex,standard] (o27) -| (aux68);
\end{scope}
\node[wordnode,anchor=south west] () at (aux21) {$h_t$};
\node[wordnode,anchor=south west] () at (aux51) {$c_t$};
\node[wordnode,anchor=south east] () at (aux29) {$h_{t+1}$};
\node[wordnode,anchor=south east] () at (aux59) {$c_{t+1}$};
\node[wordnode,anchor=south west] () at (aux12) {$x_t$};
\node[wordnode,anchor=north east] () at (aux68) {$h_{t+1}$};
\end{tikzpicture}
\end{center}
\end{frame}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论