|
|
@ -1,8 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
%%% Local Variables:
|
|
|
|
|
|
|
|
%%% mode: latex
|
|
|
|
|
|
|
|
%%% TeX-master: "main"
|
|
|
|
|
|
|
|
%%% End:
|
|
|
|
|
|
|
|
\section{Introduction to Neural Networks}
|
|
|
|
\section{Introduction to Neural Networks}
|
|
|
|
|
|
|
|
|
|
|
|
Neural Networks (NN) are a mathematical construct inspired by the
|
|
|
|
Neural Networks (NN) are a mathematical construct inspired by the
|
|
|
@ -34,6 +30,8 @@ except for the input layer, which recieves the components of the input.
|
|
|
|
|
|
|
|
|
|
|
|
\resizebox{\textwidth}{!}{%
|
|
|
|
\resizebox{\textwidth}{!}{%
|
|
|
|
\begin{tikzpicture}[x=1.75cm, y=1.75cm, >=stealth]
|
|
|
|
\begin{tikzpicture}[x=1.75cm, y=1.75cm, >=stealth]
|
|
|
|
|
|
|
|
\tikzset{myptr/.style={decoration={markings,mark=at position 1 with %
|
|
|
|
|
|
|
|
{\arrow[scale=1.5,>=stealth]{>}}},postaction={decorate}}}
|
|
|
|
|
|
|
|
|
|
|
|
\foreach \m/\l [count=\y] in {1,2,3,missing,4}
|
|
|
|
\foreach \m/\l [count=\y] in {1,2,3,missing,4}
|
|
|
|
\node [every neuron/.try, neuron \m/.try] (input-\m) at (0,2.5-\y) {};
|
|
|
|
\node [every neuron/.try, neuron \m/.try] (input-\m) at (0,2.5-\y) {};
|
|
|
@ -48,7 +46,7 @@ except for the input layer, which recieves the components of the input.
|
|
|
|
\node [every neuron/.try, neuron \m/.try ] (output-\m) at (7,1.5-\y) {};
|
|
|
|
\node [every neuron/.try, neuron \m/.try ] (output-\m) at (7,1.5-\y) {};
|
|
|
|
|
|
|
|
|
|
|
|
\foreach \l [count=\i] in {1,2,3,d_i}
|
|
|
|
\foreach \l [count=\i] in {1,2,3,d_i}
|
|
|
|
\draw [<-] (input-\i) -- ++(-1,0)
|
|
|
|
\draw [myptr] (input-\i)+(-1,0) -- (input-\i)
|
|
|
|
node [above, midway] {$x_{\l}$};
|
|
|
|
node [above, midway] {$x_{\l}$};
|
|
|
|
|
|
|
|
|
|
|
|
\foreach \l [count=\i] in {1,n_1}
|
|
|
|
\foreach \l [count=\i] in {1,n_1}
|
|
|
@ -58,20 +56,20 @@ except for the input layer, which recieves the components of the input.
|
|
|
|
\node [above] at (hidden2-\i.north) {$\mathcal{N}_{l,\l}$};
|
|
|
|
\node [above] at (hidden2-\i.north) {$\mathcal{N}_{l,\l}$};
|
|
|
|
|
|
|
|
|
|
|
|
\foreach \l [count=\i] in {1,d_o}
|
|
|
|
\foreach \l [count=\i] in {1,d_o}
|
|
|
|
\draw [->] (output-\i) -- ++(1,0)
|
|
|
|
\draw [myptr] (output-\i) -- ++(1,0)
|
|
|
|
node [above, midway] {$O_{\l}$};
|
|
|
|
node [above, midway] {$O_{\l}$};
|
|
|
|
|
|
|
|
|
|
|
|
\foreach \i in {1,...,4}
|
|
|
|
\foreach \i in {1,...,4}
|
|
|
|
\foreach \j in {1,...,2}
|
|
|
|
\foreach \j in {1,...,2}
|
|
|
|
\draw [->] (input-\i) -- (hidden1-\j);
|
|
|
|
\draw [myptr] (input-\i) -- (hidden1-\j);
|
|
|
|
|
|
|
|
|
|
|
|
\foreach \i in {1,...,2}
|
|
|
|
\foreach \i in {1,...,2}
|
|
|
|
\foreach \j in {1,...,2}
|
|
|
|
\foreach \j in {1,...,2}
|
|
|
|
\draw [->] (hidden1-\i) -- (hidden2-\j);
|
|
|
|
\draw [myptr] (hidden1-\i) -- (hidden2-\j);
|
|
|
|
|
|
|
|
|
|
|
|
\foreach \i in {1,...,2}
|
|
|
|
\foreach \i in {1,...,2}
|
|
|
|
\foreach \j in {1,...,2}
|
|
|
|
\foreach \j in {1,...,2}
|
|
|
|
\draw [->] (hidden2-\i) -- (output-\j);
|
|
|
|
\draw [myptr] (hidden2-\i) -- (output-\j);
|
|
|
|
|
|
|
|
|
|
|
|
\node [align=center, above] at (0,2) {Input\\layer};
|
|
|
|
\node [align=center, above] at (0,2) {Input\\layer};
|
|
|
|
\node [align=center, above] at (2,2) {Hidden \\layer $1$};
|
|
|
|
\node [align=center, above] at (2,2) {Hidden \\layer $1$};
|
|
|
@ -84,7 +82,10 @@ except for the input layer, which recieves the components of the input.
|
|
|
|
\caption{test}
|
|
|
|
\caption{test}
|
|
|
|
\end{figure}
|
|
|
|
\end{figure}
|
|
|
|
|
|
|
|
|
|
|
|
\begin{tikzpicture}[x=1.5cm, y=1.5cm, >=stealth]
|
|
|
|
\begin{figure}
|
|
|
|
|
|
|
|
\begin{tikzpicture}[x=1.5cm, y=1.5cm]
|
|
|
|
|
|
|
|
\tikzset{myptr/.style={decoration={markings,mark=at position 1 with %
|
|
|
|
|
|
|
|
{\arrow[scale=1.5,>=stealth]{>}}},postaction={decorate}}}
|
|
|
|
|
|
|
|
|
|
|
|
\foreach \m/\l [count=\y] in {1}
|
|
|
|
\foreach \m/\l [count=\y] in {1}
|
|
|
|
\node [every neuron/.try, neuron \m/.try] (input-\m) at (0,0.5-\y) {};
|
|
|
|
\node [every neuron/.try, neuron \m/.try] (input-\m) at (0,0.5-\y) {};
|
|
|
@ -96,7 +97,7 @@ except for the input layer, which recieves the components of the input.
|
|
|
|
\node [every neuron/.try, neuron \m/.try ] (output-\m) at (2.5,0.5-\y) {};
|
|
|
|
\node [every neuron/.try, neuron \m/.try ] (output-\m) at (2.5,0.5-\y) {};
|
|
|
|
|
|
|
|
|
|
|
|
\foreach \l [count=\i] in {1}
|
|
|
|
\foreach \l [count=\i] in {1}
|
|
|
|
\draw [<-] (input-\i) -- ++(-1,0)
|
|
|
|
\draw [myptr] (input-\i)+(-1,0) -- (input-\i)
|
|
|
|
node [above, midway] {$x$};
|
|
|
|
node [above, midway] {$x$};
|
|
|
|
|
|
|
|
|
|
|
|
\foreach \l [count=\i] in {1,2,n-1,n}
|
|
|
|
\foreach \l [count=\i] in {1,2,n-1,n}
|
|
|
@ -106,19 +107,127 @@ except for the input layer, which recieves the components of the input.
|
|
|
|
\node [above] at (output-\i.north) {};
|
|
|
|
\node [above] at (output-\i.north) {};
|
|
|
|
|
|
|
|
|
|
|
|
\foreach \l [count=\i] in {1}
|
|
|
|
\foreach \l [count=\i] in {1}
|
|
|
|
\draw [->] (output-\i) -- ++(1,0)
|
|
|
|
\draw [myptr, >=stealth] (output-\i) -- ++(1,0)
|
|
|
|
node [above, midway] {$y$};
|
|
|
|
node [above, midway] {$y$};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\foreach \i in {1}
|
|
|
|
\foreach \i in {1}
|
|
|
|
\foreach \j in {1,2,...,3,4}
|
|
|
|
\foreach \j in {1,2,...,3,4}
|
|
|
|
\draw [->] (input-\i) -- (hidden-\j);
|
|
|
|
\draw [myptr, >=stealth] (input-\i) -- (hidden-\j);
|
|
|
|
|
|
|
|
|
|
|
|
\foreach \i in {1,2,...,3,4}
|
|
|
|
\foreach \i in {1,2,...,3,4}
|
|
|
|
\foreach \j in {1}
|
|
|
|
\foreach \j in {1}
|
|
|
|
\draw [->] (hidden-\i) -- (output-\j);
|
|
|
|
\draw [myptr, >=stealth] (hidden-\i) -- (output-\j);
|
|
|
|
|
|
|
|
|
|
|
|
\node [align=center, above] at (0,1) {Input \\layer};
|
|
|
|
\node [align=center, above] at (0,1) {Input \\layer};
|
|
|
|
\node [align=center, above] at (1.25,3) {Hidden layer};
|
|
|
|
\node [align=center, above] at (1.25,3) {Hidden layer};
|
|
|
|
\node [align=center, above] at (2.5,1) {Output \\layer};
|
|
|
|
\node [align=center, above] at (2.5,1) {Output \\layer};
|
|
|
|
|
|
|
|
|
|
|
|
\end{tikzpicture}
|
|
|
|
\end{tikzpicture}
|
|
|
|
|
|
|
|
\caption{Shallow Neural Network with input- and output-dimension of \(d
|
|
|
|
|
|
|
|
= 1\)}
|
|
|
|
|
|
|
|
\end{figure}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\begin{figure}
|
|
|
|
|
|
|
|
\begin{tikzpicture}[x=1.5cm, y=1.5cm, >=stealth]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\tikzset{myptr/.style={decoration={markings,mark=at position 1 with %
|
|
|
|
|
|
|
|
{\arrow[scale=1.5,>=stealth]{>}}},postaction={decorate}}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\node [circle, draw, fill=black, inner sep = 0pt, minimum size =
|
|
|
|
|
|
|
|
1.5mm, left] (i_1) at (0, 2.5) {};
|
|
|
|
|
|
|
|
\node [align=left, left] at (-0.125, 2.5) {\(i_1\)};
|
|
|
|
|
|
|
|
\node [circle, draw, fill=black, inner sep = 0pt, minimum size =
|
|
|
|
|
|
|
|
1.5mm] (i_2) at (0, 1.25) {};
|
|
|
|
|
|
|
|
\node [align=left, left] at (-0.125, 1.25) {\(i_2\)};
|
|
|
|
|
|
|
|
\node [neuron missing] (i_3) at (0, 0) {};
|
|
|
|
|
|
|
|
\node [circle, draw, fill=black, inner sep = 0pt, minimum size =
|
|
|
|
|
|
|
|
1.5mm] (i_4) at (0, -1.25) {};
|
|
|
|
|
|
|
|
\node [align=left, left] at (-0.125, -1.25) {\(i_m\)};
|
|
|
|
|
|
|
|
\draw[decoration={calligraphic brace,amplitude=5pt, mirror}, decorate, line width=1.25pt]
|
|
|
|
|
|
|
|
(-0.6,2.7) -- (-0.6,-1.45) node [black, midway, xshift=-0.6cm, left] {Input};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\node [align = center, above] at (1.25, 3) {Synaptic\\weights};
|
|
|
|
|
|
|
|
\node [every neuron] (w_1) at (1.25, 2.5) {\(w_{k, 1}\)};
|
|
|
|
|
|
|
|
\node [every neuron] (w_2) at (1.25, 1.25) {\(w_{k, 2}\)};
|
|
|
|
|
|
|
|
\node [neuron missing] (w_3) at (1.25, 0) {};
|
|
|
|
|
|
|
|
\node [every neuron] (w_4) at (1.25, -1.25) {\(w_{k, m}\)};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\node [circle, draw] (sig) at (3, 0.625) {\Large\(\sum\)};
|
|
|
|
|
|
|
|
\node [align = center, below] at (3, 0) {Summing \\junction};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\node [draw, minimum size = 1.25cm] (act) at (4.5, 0.625)
|
|
|
|
|
|
|
|
{\(\psi(.)\)};
|
|
|
|
|
|
|
|
\node [align = center, above] at (4.5, 1.25) {Activation \\function};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\node [circle, draw, fill=black, inner sep = 0pt, minimum size =
|
|
|
|
|
|
|
|
1.5mm] (b) at (3, 2.5) {};
|
|
|
|
|
|
|
|
\node [align = center, above] at (3, 2.75) {Bias \\\(b_k\)};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\node [align = center] (out) at (6, 0.625) {Output \\\(o_k\)};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\draw [myptr] (i_1) -- (w_1);
|
|
|
|
|
|
|
|
\draw [myptr] (i_2) -- (w_2);
|
|
|
|
|
|
|
|
\draw [myptr] (i_4) -- (w_4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\draw [myptr] (w_1) -- (sig);
|
|
|
|
|
|
|
|
\draw [myptr] (w_2) -- (sig);
|
|
|
|
|
|
|
|
\draw [myptr] (w_4) -- (sig);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\draw [myptr] (b) -- (sig);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\draw [myptr] (sig) -- (act);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\draw [myptr] (act) -- (out);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% \foreach \m [count=\y] in {1,2,missing,3,4}
|
|
|
|
|
|
|
|
% \node [every neuron/.try, neuron \m/.try ] (hidden-\m) at (1.25,3.25-\y*1.25) {\(w_{k,\y}\)};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% \foreach \m [count=\y] in {1}
|
|
|
|
|
|
|
|
% \node [every neuron/.try, neuron \m/.try ] (output-\m) at (2.5,0.5-\y) {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% \foreach \l [count=\i] in {1}
|
|
|
|
|
|
|
|
% \draw [<-] (input-\i) -- ++(-1,0)
|
|
|
|
|
|
|
|
% node [above, midway] {$x$};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% \foreach \l [count=\i] in {1,2,n-1,n}
|
|
|
|
|
|
|
|
% \node [above] at (hidden-\i.north) {$\mathcal{N}_{\l}$};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% \foreach \l [count=\i] in {1,n_l}
|
|
|
|
|
|
|
|
% \node [above] at (output-\i.north) {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% \foreach \l [count=\i] in {1}
|
|
|
|
|
|
|
|
% \draw [->] (output-\i) -- ++(1,0)
|
|
|
|
|
|
|
|
% node [above, midway] {$y$};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% \foreach \i in {1}
|
|
|
|
|
|
|
|
% \foreach \j in {1,2,...,3,4}
|
|
|
|
|
|
|
|
% \draw [->] (input-\i) -- (hidden-\j);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% \foreach \i in {1,2,...,3,4}
|
|
|
|
|
|
|
|
% \foreach \j in {1}
|
|
|
|
|
|
|
|
% \draw [->] (hidden-\i) -- (output-\j);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\end{tikzpicture}
|
|
|
|
|
|
|
|
\caption{Structure of a single neuron}
|
|
|
|
|
|
|
|
\end{figure}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\begin{tikzpicture}
|
|
|
|
|
|
|
|
\tikzset{myptr/.style={decoration={markings,mark=at position 1 with %
|
|
|
|
|
|
|
|
{\arrow[scale=2,>=stealth]{>}}},postaction={decorate}}}
|
|
|
|
|
|
|
|
%1
|
|
|
|
|
|
|
|
\draw [->,>=stealth] (0,.5) -- (2,.5);
|
|
|
|
|
|
|
|
%2
|
|
|
|
|
|
|
|
\draw [myptr] (0,0) -- (2,0);
|
|
|
|
|
|
|
|
\end{tikzpicture}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%%% Local Variables:
|
|
|
|
|
|
|
|
%%% mode: latex
|
|
|
|
|
|
|
|
%%% TeX-master: "main"
|
|
|
|
|
|
|
|
%%% End:
|
|
|
|