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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| \begin{tikzpicture}[ node distance=1.5cm, neuron/.style={circle, draw, minimum size=8mm, thick}, input neuron/.style={neuron, fill=green!30}, hidden neuron/.style={neuron, fill=blue!30}, output neuron/.style={neuron, fill=red!30}, annot/.style={text width=4em, text centered} ]
\foreach \y in {1,...,4} \node[input neuron] (I-\y) at (0,-\y) {};
\foreach \y in {1,...,5} \node[hidden neuron] (H1-\y) at (2.5,-\y+0.5) {};
\foreach \y in {1,...,5} \node[hidden neuron] (H2-\y) at (5,-\y+0.5) {};
\foreach \y in {1,...,2} \node[output neuron] (O-\y) at (7.5,-\y-1) {};
\foreach \source in {1,...,4} \foreach \dest in {1,...,5} \draw[->] (I-\source) -- (H1-\dest);
\foreach \source in {1,...,5} \foreach \dest in {1,...,5} \draw[->] (H1-\source) -- (H2-\dest);
\foreach \source in {1,...,5} \foreach \dest in {1,...,2} \draw[->] (H2-\source) -- (O-\dest);
\node[annot, above of=I-1, node distance=1cm] {输入层}; \node[annot, above of=H1-1, node distance=1cm] {隐藏层1}; \node[annot, above of=H2-1, node distance=1cm] {隐藏层2}; \node[annot, above of=O-1, node distance=1cm] {输出层};
\end{tikzpicture}
|