-
Notifications
You must be signed in to change notification settings - Fork 3
/
rnn-demo.tex
28 lines (28 loc) · 1.29 KB
/
rnn-demo.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{positioning,chains}
\begin{document}
\begin{tikzpicture}[item/.style={circle,draw,thick,align=center},
itemc/.style={item,on chain,join}]
\begin{scope}[start chain=going right,nodes=itemc,every
join/.style={-latex,very thick},local bounding box=chain]
\path node (A0) {$A$} node (A1) {$A$} node (A2) {$A$} node[xshift=2em] (At)
{$A$};
\end{scope}
\node[left=1em of chain,scale=2] (eq) {$=$};
\node[left=2em of eq,item] (AL) {$A$};
\path (AL.west) ++ (-1em,2em) coordinate (aux);
\draw[very thick,-latex,rounded corners] (AL.east) -| ++ (1em,2em) -- (aux)
|- (AL.west);
\foreach \X in {0,1,2,t}
{\draw[very thick,-latex] (A\X.north) -- ++ (0,2em)
node[above,item,fill=gray!10] (h\X) {$h_\X$};
\draw[very thick,latex-] (A\X.south) -- ++ (0,-2em)
node[below,item,fill=gray!10] (x\X) {$x_\X$};}
\draw[white,line width=0.8ex] (AL.north) -- ++ (0,1.9em);
\draw[very thick,-latex] (AL.north) -- ++ (0,2em)
node[above,item,fill=gray!10] {$h_t$};
\draw[very thick,latex-] (AL.south) -- ++ (0,-2em)
node[below,item,fill=gray!10] {$x_t$};
\path (x2) -- (xt) node[midway,scale=2,font=\bfseries] {\dots};
\end{tikzpicture}
\end{document}