神经网络结构图(LaTeX)

代码如下:

\documentclass{article}
\usepackage{tikz}
\begin{document}
	\begin{tikzpicture}[every node/.style={align=center}]
	\foreach \x in{1,2,3,4,5}
	\fill[red!60](0,\x)circle(5pt)node(a\x){};
	\fill[blue!60](-2,1.5)circle(5pt)node(b1){};
	\fill[blue!60](-2,2.5)circle(5pt)node(b2){};
	\fill[blue!60](-2,3.5)circle(5pt)node(b3){};
	\fill[blue!60](-2,4.5)circle(5pt)node(b4){};
	\fill[blue](2,3)circle(5pt)node(c){};
	\node(y4)at(-3,4.5){$x_1$};
	\node(y3)at(-3,3.5){$\vdots$};
	\node(y2)at(-3,2.5){$x_n$};
	\node(y1)at(-3,1.5){bias:1};
	\node at(-2,6){Input\\layer};
	\node at(0,6){Hidden\\layer};
	\node at(2,6){Output\\layer};
	\node(d)at(3.5,3){$N(x,p)$};
	\draw[-stealth](c)--(d);
	\foreach \x in{1,2,3,4}
	\draw[-{stealth[sep=2pt]}](y\x)--(b\x);
	\foreach \x in{1,2,3,4}
	{\foreach \y in{1,2,3,4,5}
		{\draw[-{stealth[sep=2pt]}](b\x)--(a\y);
			\draw[-{stealth[sep=4pt]}](a\y)--(c.west);
		}
	}
	\end{tikzpicture}
\end{document}

神经网络结构图(LaTeX)_第1张图片

你可能感兴趣的:(LaTeX)