我需要绘制一个具有相同架构的循环神经网络,如下所示
换句话说,一个 RNN 具有一个输入、一个单个隐藏和循环单元和一个输出。
但是,我希望它具有以下 Goodfellow 风格,换句话说,我希望所有单位都是(白色或灰色)圆圈。
我尝试查看其他帖子。例如,以下帖子:如何绘制循环神经网络,但我不确定如何修改代码。
答案1
我不确定这是否是这个网站的目的。恕我直言,你应该自己尝试一下,如果你遇到困难,你会得到更热情的回答,但无论如何......
\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}