%%%------------------------------------------------------------------------------------------------------------ \begin{tikzpicture} %% a two-layer neural network \begin{scope} \tikzstyle{neuronnode} = [minimum size=1.7em,circle,draw,ublue,very thick,inner sep=1pt, fill=white,align=center,drop shadow={shadow xshift=0.1em,shadow yshift=-0.1em}] %% input and hidden layers \node [neuronnode] (n10) at (0,0) {\tiny{$f$}\\[-1ex] \tiny{$\sum$}}; \node [neuronnode] (n11) at (1.0,0) {\tiny{$f$}\\[-1ex] \tiny{$\sum$}}; \draw [-,ublue] (n10.west) -- (n10.east); \draw [-,ublue] (n11.west) -- (n11.east); \node [anchor=north] (x1) at ([yshift=-4em]n11.south) {$x_1$}; \node [anchor=north] (b) at ([yshift=-4em]n10.south) {$\mathbi{b}$}; { \draw [->,thick] (b.north) -- ([yshift=-0.1em]n10.south); \draw [->,thick] (x1.north) -- ([yshift=-0.1em]n10.290); } { \draw [->,thick] (b.north) -- ([yshift=-0.1em]n11.250); \draw [->,thick] (x1.north) -- ([yshift=-0.1em]n11.south); } { \draw [->,thick,blue] (b.north) -- ([yshift=-0.1em]n11.250); \draw [->,thick,purple] (x1.north) -- ([yshift=-0.1em]n11.south); } %% output layers \node [neuronnode] (n20) at (0.5,4em) {\scriptsize{$\sum$}}; {\draw [->,thick,brown] ([yshift=0.1em]n10.north) -- ([yshift=-0.1em]n20.250);} {\draw [->,thick,orange] ([yshift=0.1em]n11.north) -- ([yshift=-0.1em]n20.290);} \node [] (y) at ([yshift=2.5em]n20.north) {$y$}; \draw [->,thick] ([yshift=0.1em]n20.north) -- (y.south); %% weight and bias {\node [anchor=center,rotate=90,fill=white,inner sep=1pt] (b0) at ([yshift=2em,xshift=-0.5em]b.north) {\scriptsize{$b_1$}};} {\node [anchor=center,rotate=-59,fill=white,inner sep=1pt] (w2) at ([yshift=1em,xshift=-1.0em]x1.north) {\scriptsize{$w_{11}$}};} {\node [anchor=center,rotate=62,fill=white,inner sep=1pt] (w21) at ([yshift=1.2em,xshift=-0.2em]n10.north) {\scriptsize{$w'_{11}$}};} {\node [anchor=center,rotate=-62,fill=white,inner sep=1pt] (w22) at ([yshift=1.2em,xshift=0.2em]n11.north) {\scriptsize{$w'_{21}$}};} {\node [anchor=center,rotate=59,fill=white,inner sep=1pt] (b1) at ([yshift=3.4em,xshift=1.5em]b.north) {\scriptsize{$b_2$}};} {\node [anchor=center,rotate=90,fill=white,inner sep=1pt] (w1) at ([yshift=2em,xshift=0.5em]x1.north) {\scriptsize{$w_{12}$}};} %% sigmoid box \begin{scope} { \node [anchor=west] (flabel) at ([xshift=1in]y.east) {\footnotesize{Sigmoid:}}; \node [anchor=north east] (slabel) at ([xshift=0]flabel.south east) {\footnotesize{Sum:}}; \node [anchor=west,inner sep=2pt] (flabel2) at (flabel.east) {\footnotesize{$f(s_2)=1/(1+{\textrm e}^{-s_2})$}}; \node [anchor=west,inner sep=2pt] (flabel3) at (slabel.east) {\footnotesize{$s_2=x_1 \cdot w_{12} + b$}}; \draw [->,thick,dotted] ([yshift=-0.3em,xshift=-0.1em]n11.60) .. controls +(east:1) and +(west:2) .. ([xshift=-0.2em]flabel.west) ; \begin{pgfonlayer}{background} { \node [rectangle,inner sep=0.2em,fill=blue!30,drop shadow={shadow xshift=0.1em,shadow yshift=-0.1em}] [fit = (flabel) (flabel2) (flabel3)] (funcbox) {}; } \end{pgfonlayer} } \end{scope} \end{scope} \end{tikzpicture} %%%------------------------------------------------------------------------------------------------------------