\documentstyle[12pt,eclepsf]{article}

\textheight 260mm
\topmargin -10mm
\textwidth 180mm
\oddsidemargin -7mm

\pagestyle{myheadings}
\markright{(Neural Networks: Basic)}

\begin{document}
\begin{LARGE}

\begin{center}
\begin{Huge}
\noindent
{\bf Neural Networks: Basic}\\
\end{Huge}

\vspace{1in}
Dokuz Eyl\"{u}l University \\
Computer Engineering Department \\
\hspace*{1in}\\
\begin{large}
(25 September 2000 -- 5 January 2001)\\
\end{large}
\end{center}

\clearpage
%-----------------------------------------------------------------------
\noindent
$\Box$ {\bf Contents:}\\

\begin{itemize}
\item [ 1.] Introduction
   \begin{itemize}
   \item What are Neural Networks?
   \item Why Neural Networks?
   \end{itemize}
\end{itemize}


\clearpage
%-----------------------------------------------------------------------

\section{What is Neural Network?}

\noindent
$\Box$ A system with {\it neurons} connected with {\it synapses}, \\

\noindent
where
\begin{itemize}
\item synapse: 
   \begin{itemize}
   \item[] transmits input state value (usually either one or zero)
           with its weight value being multiplied to the input; and
   \end{itemize}
\item neuron: 
   \begin{itemize}
    \item[] takes the weighted sum of fan-in inputs, and
            outputs its function value of the specified
            {\it transfer function} $f(x)$.\\
   \end{itemize}
\end{itemize}

\hspace{1in}\\
\hspace{1in}\\

\noindent
$\Box$ Typically categorized into two forms:
\begin{itemize}
\item[1.] Layered (feed forward)
\item[2.] Fully-connected
\end{itemize}

\vfill
\noindent
{\bf Keywords:
\begin{itemize}
\item 
neuron, synapse, weight, transfer-function,
layered, feed-forward, fully-connected
\end{itemize}}
\clearpage
%-----------------------------------------------------------------------

\subsection{}
{\bf Perceptron}\\

\noindent
$\Box$ An example of single-layered feed forward neural network.\\

\noindent
Suppose:
\begin{itemize}
\item $M$ inputs: $x_1, \cdots x_M$;
\item $N$ outputs: $y_1, \cdots y_N$;
\item each $N$ output neurons are connected with all $M$ input neurons;
\item weight values (of the synapse) from (input) neuron j to (output)  
      neuron $k$ is $w_{jk}$;
\end{itemize}

\hspace{1in}\\

\noindent
then\\
\begin{equation}
y_i = f(\sum_{k=1}^{N} w_{ki}x_k),
\end{equation}
where\\
\begin{equation}
f(x) = \mbox{sgn} (x) \hspace{.2in}  
\mbox{or} \hspace{.2in} f(x) = \tan ^{-1} (x). 
\end{equation}



\vfill
\noindent
{\bf Keywords:
\begin{itemize}
\item perceptron
\end{itemize}}
\clearpage
%-----------------------------------------------------------------------

\noindent
$\Box$ Analogy from nature:
\begin{itemize}
\item from sensors at retina to sensori-motor-output in brain.
\end{itemize}

\hspace{1in}\\
\hspace{1in}\\

\noindent
$\Box$ What can we do with this?
\begin{itemize}
\item prediction of sun-spots, stock market, etc
\item character recognition
\item $\cdots$
\end{itemize}

\hspace{1in}\\
\hspace{1in}\\

\noindent
$\Box$ How can we specify weight values?

\begin{itemize}
\item Learning by themselves (a sort of Machine Learning).
   \begin{itemize}
   \item Supervised Learning (= Learning with Teacher)
   \item Unsupervised Learning (= Learning without Teacher)
   \end{itemize}
\end{itemize}

\vfill
\noindent
{\bf Keywords:
\begin{itemize}
\item learning, supervised, unsupervised
\end{itemize}}
\clearpage
%-----------------------------------------------------------------------
\subsubsection{}
\noindent
{\bf The simplest example.}\\

\begin{itemize}
\item[1.] AND with two inputs and one output
   \begin{itemize}
   \item[] e.g., 
      \begin{itemize}
      \item $w_{00}=w_{01}=0.7$
      \end{itemize}
   \end{itemize}
\item[2.] How about OR?
   \begin{itemize}
   \item[] e.g., 
      \begin{itemize}
      \item $w_{00}=w_{01}=1.4$
      \end{itemize}
   \end{itemize}
\item[3.] How about XOR?
   \begin{itemize}
   \item Impossible by single layer perceptron.
   \end{itemize}
\end{itemize}

\vfill
\noindent
{\bf Keywords:
\begin{itemize}
\item synaptic plasticity
\end{itemize}}

\clearpage
%-----------------------------------------------------------------------
\subsubsection{}
\noindent
{\bf Perceptron with hidden layers}\\

\noindent
Adding intermediate layer(s) called {\it hidden layer(s)}
between input and output.
\begin{itemize}
\item Suppose $K$ hidden layers.
\item weight from neuron $i$ of the $k$-th layer
               to neuron $j$ of the next layer is denoted as $w_{ij}^k$.
\end{itemize}

\hspace*{1in}\\

\begin{itemize}
\item XOR revisited
   \begin{itemize}
   \item[] e.g., \\
      \begin{itemize}
      \item $w_{00}^0 = w_{01}^0 =0.7$, \hspace{.1in}
            $w_{10}^0=w_{11}^0=1.4$,\\
            \hspace*{1in}\\
            $w_{10}^1 = -1.4, \hspace{.1in} w_{11}^1 =1.4$.
      \end{itemize}
   \end{itemize}
\end{itemize}
\clearpage
\begin{itemize}
\item Separability \\
   \begin{itemize}
   \item If we can separate the solution space by hyperplane,\\
      \begin{itemize}
      \item[] (To be more specific, we can separate 2D solution space of 
               2-input AND/OR by a straight line, but not for XOR.)\\
      \end{itemize}
   \item[] then we can solve the problem by single perceptron.\\
   \item Multi-layer allows us to separate the space by more flexible
         surface, not necessarily the plane.
   \end{itemize}
\end{itemize}

\vfill
\noindent
{\bf Keywords:
\begin{itemize}
\item hidden layer, separability, solution-space
\end{itemize}}

\clearpage
%-----------------------------------------------------------------------
\subsection{}
{\bf Examples of Learning}\\

\begin{itemize}
\item Perceptron Learning
\item Gradient Learning
\item Error Back Propagation
\item Evolutionary computation (such as GA)
\item etc
\end{itemize}

\clearpage
%-----------------------------------------------------------------------
\subsubsection{}
{\bf Perceptron Learning}\\

\begin{itemize}
\item Assume $M$ input and $N$ output neurons.\\
\end{itemize}

\begin{itemize}
\item Also assume that we have $p$ examples 
\end{itemize}
\begin{equation}
\sigma_{i}^{\mu}, \hspace{.2in} \mu = 1, 2, \cdots, p, 
\hspace{.2in} i = 1,2, \cdots, M, 
\end{equation}
\begin{itemize}
\item[]whose desired output are known, i.e.,
\end{itemize}
\begin{equation}
\zeta_{j}^{\mu}, \hspace{.1in} i = 1,2, \cdots, N.\\
\end{equation}
\begin{itemize}
\item[] while real output was
\end{itemize}
\begin{equation}
S_{i}^{\mu}, \hspace{.2in} i = 1,2, \cdots, N.
\end{equation}



\hspace*{1in}\\
\begin{itemize}
\item Then we modify $w_{ij}$ by adding:
\end{itemize}
\begin{equation}
\delta w_{ik} = \epsilon (\zeta_i^{\mu} - S_i^{\mu}) \sigma_k^{\mu},
\end{equation}
\begin{itemize}
\item[] in each iteration of giving example, and we obtain
\end{itemize}
\begin{equation}
w_{ik}^{\mbox{\large{new}}} = w_{ik}^{\mbox{\large{old}}} + \delta w_{ik},
\end{equation}
\begin{itemize}
\item[] (implying {\it if correct do nothing, otherwise modify.)}
\end{itemize}
\hspace*{1in}\\
\begin{itemize}
\item Note that 
each of $\sigma_k^{\mu}, \hspace{.1in} S_{i}^{\mu}, \hspace{.1in} and  
\hspace{.1in} \zeta_k^{\mu}$ takes either 1 or $-1$.
\end{itemize}
\clearpage
\noindent
$\Box$ {\bf Try to calculate the below by hand.}\\
\begin{itemize}
\item Three binary inputs and two binary outputs. \\
\item If the number of $+1$ is even then output should be $-1 +1$ \\
      If the number of $+1$ is odd then output should be $+1 -1$ \\
      (that is to say, $y_1$ is {\it odd-flag} and $y_2$ is 
       {\it even-flag}.) \\
\item Pick up 6 examples out of 8 possible input to give them 
      for adjusting $w_{ij}$'s. \\
\item Apply the Perceptron Learning Algorithm with
   \begin{itemize}
   \item[] $ \epsilon = 0.05 $
   \item[] $ f(x) = \mbox{sgn} (x - 1) $ \\
   \end{itemize}
\item Repeat giving the examples until $w_{ij}$ won't change any more.
      (You may use one example multiple time if needed.)\\
\item Test the results with 2 remaining possible inputs.
\end{itemize}

\hspace*{1in}\\
\hspace*{1in}\\

\noindent
$\Box$ {\bf Try to make program for the one with 10 inputs.}

\clearpage
\noindent
$\Box${\bf Analog vs Binary Neurons}\\
\begin{itemize}
\item Binary:
   \begin{itemize}
   \item Typical Transfer function:
      \begin{itemize}
      \item[]$\displaystyle y_i = \mbox{sgn} (\sum_k w_{ik}x_k - \theta)$
      \end{itemize}
   \item What does this imply?
   \item $\theta$ is called {\it threshold}.\\
   \end{itemize}
\item Analog:
   \begin{itemize}
   \item $\displaystyle y_i = f (\sum_k w_{ik}x_k - \theta)$
   \item $ f(h) = \tanh (\beta h) $ \\
   \end{itemize}
\end{itemize}
\hspace*{1in}
\begin{center} \underline{\hspace*{7in}} \\ \end{center}
\begin{large}
\noindent
From the definitions:
\begin{equation}
e^{jx} = \cos x + j \sin x;
\end{equation}
\begin{equation}
e^{-jx} = \cos x - j \sin x,
\end{equation}
\noindent
we obtain
\begin{equation}
\cos x = \frac { e^{jx} + e^{-jx}} {2}; 
\end{equation}
\begin{equation}
\sin x = \frac { e^{jx} - e^{-jx}} {2}; 
\end{equation}
We extend them to
\begin{equation}
\cosh x = \frac { e^{x} + e^{-x}} {2}; 
\end{equation}
\begin{equation}
\sinh x = \frac { e^{x} - e^{-x}} {2}; 
\end{equation}
So,
\begin{equation}
\tanh x = \frac {e^{x} - e^{-x}} {e^{x} + e^{-x}} 
        = \frac {1 - e^{-2x}} {1 + e^{-2x}} 
\end{equation}
\end{large}

\clearpage
\noindent
$\Box$ {\bf Gradient Learning} (Learning for analog neurons.)\\

\noindent
Squared Error of outputs:\\

\begin{equation}
D = \sum_{\mu} \sum_i (S_i^{\mu} - {\zeta}_i^{\mu}),
\end{equation}

\noindent
where\\

\begin{equation}
S_i^{\mu} = f (\sum_k w_{ik}{\sigma}_k^{\mu});\\
\end{equation}
\begin{equation}
f(h) = \tanh (\beta h) \\
\end{equation}

\hspace*{1in}\\
\noindent
defines an {\it error surface} of high dimensionality.\\

\hspace*{1in}\\
\noindent
Then, the {\it gradient} of $D$ w.r.t. $w_{ij}$ modifies $w_{ij}$ as:\\
\begin{equation}
\delta w_{ik} \equiv - \epsilon \frac{\partial D}{\partial w_{ik}}
= \cdots 
= \epsilon \sum_{\mu} ({\zeta}_i^{\mu} - S_i^{\mu}) f^{\prime} 
  ( \sum_k w_{ik} {\sigma}_k^{\mu}),\\
\end{equation}

\hspace*{1in}\\
\noindent
where\\
\begin{equation}
f^{\prime}(x) = \beta \{ 1 - f(x)^2 \}. 
\end{equation}

\hspace*{1in}
\begin{center} \underline{\hspace*{7in}} \\ \end{center}
\begin{large}
\noindent
Though there exist many alternatives 
to find minima of a non-linear function $g(\mbox{\bf x})$, 
{\it steepest descent}
\begin{equation}
\mbox{\bf x}_{n+1} = \mbox{\bf x}_n - \epsilon \nabla g(\mbox{\bf x}_n)
\end{equation}
is sufficient in most cases.
\end{large}

\clearpage
\noindent
{\bf Back Propagation Algorithm}\\

\noindent
$\Box$ Definition of variables:

\begin{itemize}
\item $L$ layers of neurons.
\item $k_r$ neurons in the $r$-$th$ layer.\hspace{.2in} 
      $r = 1,2, \cdots, L.$
\item $l$ input neurons ($k_0 = l$).
\item $w_{jk}^r$: weight to the $j$-$th$ neuron 
      in the $r$-$th$ layer from the $k$-$th$ neuron 
      in the previous layer.
\item $N$ training pairs: $(\mbox{\bf x}(i),\mbox{\bf y}(i))$, 
      \hspace{.2in} $i = 1, 2, \cdots, N$.
\item $y_k^{r}(i)$: the output of the $k$-$th$ neuron in the $r$-$th$
                     layer when the $i$-$th$ training sample is given.
\item fan-in's to $j$-$th$ neuron in the $r$-$th$
                     layer when the $i$-$th$ training sample is given.
   \begin{itemize}
   \item[] $\displaystyle 
           h_j^r(i) \equiv 
           \sum_{k=1}^{k_{r-1}}w_{jk}^r y_k^{r-1}(i) + w_{j0}^r =
           \sum_{k=0}^{k_{r-1}}w_{jk}^r y_k^{r-1}(i)$,
   \end{itemize}
\item[] where $y_0^{r-1} = 1$ and 
   \begin{itemize}
   \item[] $(y_1^0(i), \cdots,  y_l^0(i)) = 
            (x_1(i),   \cdots,    x_l(i)) = \mbox{\bf x}(i) $. 
   \end{itemize}
\item Each output neuron's error: 
   \begin{itemize}
   \item[] $ e_m(i) \equiv y_m(i)- \hat{y}_m(i)$, \hspace{.2in}
           $ i = 1,2, \cdots, N $.
   \end{itemize}
\item[] where $ (\hat{y}_1(i), \cdots, \hat{y}_{k_{\small L}}(i)) 
                = \mbox{\bf y}(i)$
\item Error function to be minimized:
   \begin{itemize}
   \item[] $\displaystyle D= 
           \frac{1}{2} \sum_{i=1}^{N} \sum_{m=1}^{k_{\small L}} e_m(i)^2$
   \end{itemize}
\end{itemize}


\clearpage
\noindent
$\Box$ The algorithm:
\begin{itemize}
\item[1.] {\it Initialization:} Initialize all the weights with small 
          random values.
\item[2.] {\it Forward computations:} For each of the training vectors
   \begin{itemize}
   \item[] $\mbox{\bf x}(i), \hspace{.2in} i = 1, 2, \cdots, N $
   \end{itemize}
\item[] compute all the 
   \begin{itemize}
   \item[] $y_j^r(i) = f (h_j^r(i))$
   \end{itemize}
\item[] for $j = 1, 2, \cdots, k_r $ and $ r = 1, 2, \cdots, L$.
\item[3.] {Backward computations:} For each $i = 1, 2, \cdots, N$, 
          and $j = 1, 2, \cdots, k_{\small L} $ compute
   \begin{itemize}
   \item[] $ \delta_j^L(i) = e_j(i)f^{\prime}(h_j^L(i))$
   \end{itemize}
\item[] then compute
   \begin{itemize}
   \item[] $ \delta_j^{r-1}(i) = e_j^{r-1}(i)f^{\prime}(h_j^{r-1}(i))$
   \end{itemize}
\item[]for $ r = L, L-1, \cdots ,2$ and $j = 1, 2, \cdots, k_r$ where
   \begin{itemize}
   \item[] $ \displaystyle e_j^{r-1}(i) = 
             \sum_{k=1}^{k_r} \delta_k^r(i)w_{kj}^r $
   \end{itemize}
\item[4.] Update the weights for 
          $r=1,2, \cdots, L$ and $j = 1, 2, \cdots, k_r$
   \begin{itemize}
   \item[]$ w_{jk}^{r} \left[ \mbox{new} \right]= 
            w_{jk}^{r} \left[ \mbox{old} \right] + 
            \triangle w_{jk}^r$,
   \end{itemize}
\item[]where
   \begin{itemize}
   \item[] $\displaystyle \triangle w_{jk}^r = 
          - \epsilon \sum_{i=1}^N 
            \delta_j^r(i)y_k^{r-1}(i)$.
   \end{itemize}
\end{itemize}

\clearpage
\noindent
$\Box$ Rationale:\\

\noindent
From the {\it gradient descent}'s principle, 
\begin{equation}
\triangle w_{jk}^r = - \epsilon \frac {\partial D}{\partial w_{jk}^r}
\end{equation}
where
\begin{equation}
D = \sum_{i=1}^N \varepsilon (i)
\end{equation}
and
\begin{eqnarray}
\varepsilon (i) &=& \frac{1}{2} 
                    \sum_{i=1}^{N} \sum_{m=1}^{k_{\small L}} e_m(i)^2 \\
                &=& \frac{1}{2} 
                    \sum_{i=1}^{N} \sum_{m=1}^{k_{\small L}} 
                                (y_m(i)- \hat{y}_m(i))^2.
\end{eqnarray}
Hence
\begin{equation}
\frac{\partial \varepsilon(i)}{\partial w_{jk}^r} = 
\frac{\partial \varepsilon(i)}{\partial h_{j}^r} 
\frac{\partial h_{j}^r}{\partial w_{jk}^r}.
\end{equation}
Here we define
\begin{equation}
\frac{\partial \varepsilon(i)}{\partial h_{j}^r} \equiv \delta_j^r(i).
\end{equation}
Then
\begin{equation}
\triangle w_{jk}^r = - \epsilon \sum_{i=1}^r(i) \delta_j^r(i) y_k^{r-1}(i).
\end{equation}

\clearpage
\noindent
{\bf Applications of Neural Networks}
\begin{itemize}
\item Learning to steer a car simulator.
   \begin{itemize}
   \item[$\star$] D.\ A.\ Pomerleau (1991)
                  {\it ``Rapidly Adapting Artificial Neural Networks for 
                         Autonomous Navigation.''}
                         R.\ P.\ Lipman et al.\ (Eds.)
                         Advances in Neural Information Processing 
                         Systems 3, Morgan Kaufmann, p429.
   \end{itemize}
\item Learning to pronounce English Text (NET-Talk)
   \begin{itemize}
   \item[$\star$] T.\ J.\ Sejnowski, and C.\ R.\ Rosenberg (1987)
                  {\it ``Parallel Networks that learn to Pronounce 
                         English Texts.''}
                  Complex Systems 1, p145.
   \end{itemize}
\item Stock Price Prediction
   \begin{itemize}
   \item[$\star$] E.\ Sch\"{o}neburg (1990)\\
                  {\it ``Stock Price Prediction using Neural Networks:
                  A Project Report.''} 
                  Neurocomputing 2, p17.
   \end{itemize}
\item Learning to Play Backgammon
   \begin{itemize}
   \item[$\star$] G.\ Tesauro, T.\ J.\ Sejnowski (1988) \\
                  {\it ``A Neural Netwokr that Learns to play Backgammon.''}
                  D.\ Z.\ Anderson(Ed.) Neural Information Processing 
                  Systems. American Institute of Physics.
   \end{itemize}
\end{itemize}


\clearpage
\noindent
$\Box$ {\bf Chess (Satran\c{c}) by Neural Networks}\\
\begin{figure}[bhtp]
 \begin{center}
   \epsfile{file=chess.eps,width=16cm,height=10cm}
 \end{center}
\end{figure}

\noindent
$\bullet$ One possible implementation:
\begin{itemize}
\item[-] 64 input neurons each of which takes a value from --6 to 6 
         representing a stone, plus one input binary neuron representing 
         whose turn, which corresponds to one scene of a game.
\item[-] 2 output neurons: one takes a value from --6 to 6 and the other 
         from 1 to 64, representing a possible best movement, that is,
         which stone should be moved to where? 
         (e.g., output 1 and 48 means that the stone-1 should be moved to 
         \noindent
\end{itemize}

\clearpage
$\Box$ {\bf Backgammon (Tavla) by Neural Networks}
\begin{figure}[bhtp]
 \begin{center}
   \epsfile{file=backgamon.eps,width=12cm,height=18cm}
 \end{center}
\end{figure}

\clearpage
\noindent
$\bullet$ One possible implementation:
\begin{itemize}
\item[-] a total of 29 input neurons;
   \begin{itemize}
   \item[$\star$] 26 input neurons\footnote{two of which are for 
         the outside position of mine and opponent's, respectively}
         each of which takes a value from $-15$ to 15,
         representing a number of stones at each cite, positive ones are
         mine and negative ones are opponent's, plus two neurons with each 
         indicating the figure of two dice, 
         and one more neuron representing whose turn.
   \end{itemize}
\item[] \begin{center}\underline{\hspace*{4in}}\end{center}
\item 4 output neurons\footnote{Usually we need two but if the figures
      of two dice are identical, the number of movement is four.}
   \begin{itemize}
   \item[$\star$] each of which takes a value from 1 to 6 which indicates
         how many positions the corresponding stone proceeds.
   \end{itemize}
\item[or]
\item 24 output neurons
   \begin{itemize}
   \item[$\star$] indicating the next scene as the 24 input neurons 
                  for the purpose above. 
   \end{itemize}
\end{itemize}

\clearpage
\noindent
$\Box$ {\bf Reward and Penalty Learning:}\\

\noindent
An example on perceptron with one hidden layer.\\

\begin{itemize}
\item $N_0$ {\it analog} and {\it deterministic} output neurons:
   \begin{equation}
   y_i^2 = f(\sum_j w_{ij}^2 y_j^1)
   \end{equation}
\item[]where
   \begin{equation}
   f(x)=\frac{1}{1+ \exp (-x)}
   \end{equation}
\item {\it Binary} and {\it stochastic} hidden neurons:
   \begin{eqnarray}
   \mbox{prob}(y_i^1=1) &=& f(\sum_j w_{ij}^1 x_j)\\
   \mbox{prob}(y_i^1=0) &=& 1-f(\sum_j w_{ij}^1 x_j)
   \end{eqnarray}
\item Using
   \begin{equation}
   D=\frac{1}{N_0} \sum_i (\hat{y}_i^2 - y_i^2)^2
   \end{equation}
   \begin{itemize}
   \item modify weights to output layer by {\it gradient} method as
   \begin{equation}
   \delta w_{ij}^{\mbox{\small out}} = \epsilon (\hat{z}_i - z_i)
   f^{\prime} (\sum_k w_{ik}^{\mbox{\small out}} y_k)y_j
   \end{equation}
   \item and weights to hidden layer in a stochastic way as
   \begin{eqnarray}
   \nonumber
   \delta w_{ij}^{\mbox{\small hidden}} &=& 
   r \epsilon (y_i - f(\sum_k w_{ik}^{\mbox{\small hidden}} x_k)x_j \\
      &+&   (1-r) \lambda \epsilon (1-y_i - 
            f(\sum_k w_{ik}^{\mbox{\small hidden}} x_k)x_j
   \end{eqnarray}
   \end{itemize}
\clearpage
\item[] where $r$ is signal meaning success/failure of the task, i.e., 
   \begin{itemize}
   \item[$\star$] $r=1$ with probability $1-D$;
   \item[$\star$] $r=0$ with probability $D$.
      \begin{itemize}
      \item[] IF $rand() < 1-D$;
      \item[] \hspace*{.6in}THEN $r=1$;
      \item[] \hspace*{.6in}ELSE $r=0$;
      \end{itemize}
   \end{itemize}
\end{itemize}

\clearpage
$\bullet$ Note: Parameter notations of the previous few pages:\\
\begin{Large}
\begin{center}
The $i$-th output neuron outputs $z_i$\\
while desirerd output is $\hat{z}_i$.\\
\hspace*{1in}\\
$\Uparrow$\\
\hspace*{1in}\\
The $i$-th output neuron takes \\
\begin{displaymath}
\sum_k^{N_{\mbox{\small hidden}}} w_{ik}^{\mbox{\small out}} y_k
\end{displaymath}
from all the hidden neurons.\\
\hspace*{1in}\\
$\Uparrow$\\
\hspace*{1in}\\
Each of hidden neuron outputs $y_k$,\\
\hspace*{1in}\\
$\Uparrow$\\
\hspace*{1in}\\
The $i$-th hidden neuron takes 
\begin{displaymath}
\sum_k^{N_{\mbox{\small input}}} w_{ik}^{\mbox{\small hidden}} x_k
\end{displaymath}
from the input layer.\\
\hspace*{1in}\\
$\Uparrow$\\
\hspace*{1in}\\
Each input neuron takes an input $x_k$, and\\
send to all neurons in the hidden layer. 
\end{center}
\end{Large}

\clearpage
\begin{itemize}
\item Apply this to a task of symmetry detection.
   \begin{itemize}
   \item $n^2$ input, 12 hidden neurons, and 3 output.
   \item if the $n \times n$ pixels of the input are
      \begin{itemize}
      \item horizontally symmetric
      \item vertically symmetric
      \item diagonally symmetric
      \end{itemize}
   \item[] the 1st, 2nd and 3rd neuron should be acctivated.
   \end{itemize}
\item[]
\item Interpretation of the reward and penalty learning.
\end{itemize}

\clearpage
\noindent
$\Box$ {\bf Unsupervised Learning:}\\

\noindent
Unsupervised learning can only do anything useful 
when there is redundancy in the input data. 
{\it In this sence redundancy provides knowledge.}\\

\begin{itemize}
\item Learning by Competition.
\item Kohonen's Self-organizing Map.
\item Reinforcement Learning.\\
\end{itemize}

\noindent
{\bf (1) Unsupervised Learning through Competition:}\\

\noindent
Let $\mbox{\bf x}=(x_1,...,x_n)$ be a normalized input vector, 
i.e., 
\begin{equation}
\sum_{i=1}^n x_i = 1,
\end{equation}
in $n$-dimensional space which we want to classify in one of 
$k$ different clasters.\\

\begin{itemize}
\item The network consitsts of $n$ real-valued input neurons and 
$k$ binary output neurons (with all neurons zero-threshold.)
\item Each output neuron receives
\begin{equation}
h_i = \sum_{j=1}^{n} w_{ij}x_j
\end{equation}
from all the neurons in the input layer.\\
\item Then the only neuron which recieves
\begin{equation}
h_m = \max_i (h_i)
\end{equation}
will be on.
\clearpage
\item Learning Algorithm:\\
   \begin{itemize}
   \item[1.]  Initialize all the weights $w_{ij}$ at random, and 
              normaliz them such that
\begin{equation}
\sum_{j=1}^n w_{ij}=1 \hspace{.2in} \mbox{for} 
\hspace{.2in}\forall i=1,...,k\\
\end{equation}
   \item[2.] Selct a vector $\mbox{\bf x}^{\mu}$ at random 
             from the training sample, and compute
\begin{equation}
h_i = \sum_{j=1}^n w_{ij} x_j \hspace{.2in} \mbox{for} 
\hspace{.2in}\forall i=1,...,k\\
\end{equation}
   \item[3.] {\bf The Winner Takes All Procedure}  
      \begin{itemize}
      \item Modify only the weight $w_{mj}$ which recieves 
\begin{equation}
h_m = \max_{i} h_i
\end{equation} 
as
\begin{equation}
w_{mj}^{\mbox {\small new}} = w_{mj}^{\mbox {\small old}} + \delta w_{mj}
\end{equation}
       where
\begin{equation}\label{eq:delta}
\delta w_{mj} = \epsilon (x_k - w_{ik})
\end{equation}
and normalize them again.\\
      \end{itemize}
\item[4.] Repeat 2 and 3
          until a predetermined number of steps is reached.\\
   \end{itemize}
\item[]
\begin{large}
\item[Note that]
   \begin{itemize}
   \item[$\cdot$] The difference between this algorithm and perceptron 
                 learning is that the input set cannot be classified 
                 a priori in a positive or a negative set or in any of 
                 several different clusters.
   \item[$\cdot$] When we monitor the number of updates for each weight 
                 vector in order to make the process as balanced as 
                 possible, we call this learning with conscience.
   \end{itemize}
\end{large}
\clearpage
\item A numerical excersise:
   \begin{itemize}
   \item[] Assume three input neurons and three output neurons 
           with $w_{ij}$
\begin{eqnarray}
\left(
\begin{array}{rrr}
 0.23 & -0.72 & -0.51 \\
-0.49 &  0.33 & -0.16 \\
 0.23 &  0.68 &  0.84 \\
\end{array}
\right).
\end{eqnarray}
   \item[] Then under an input $(-1, 1, -1)$,
      \begin{itemize}
      \item  (1) obtain $h_m$;
      \item  (2) modify weights.\\
      \end{itemize}
   \end{itemize}
\item How it works?
   \begin{itemize}
   \item When we take {\bf x} and {\bf w} as
\begin{eqnarray}
\nonumber
\mbox{\bf x} &=& (x_{1}, x_{2},\cdots, x_{N_i},) \\
\nonumber
\mbox{\bf w} &=& (w_{i1}, w_{i2},\cdots, w_{i N_i},) \\
\nonumber
\end{eqnarray}
the equation (\ref{eq:delta}) implies a vector such as:
\begin{figure}[h]
 \begin{center}
   \epsfile{file=vector.eps,width=6cm,height=3cm}
 \end{center}
\end{figure}
Therefore $\mbox{\bf w}+\delta\mbox{\bf w}$ makes {\bf w}
become closer to {\bf x}, and\\
\item the more {\bf w} is closer to {\bf x}, the larger
      the inner product $h_i$ becomes.\\
\item What will happen 
      when multiple $\mbox{\bf x}^\mu$ is repeatedly given?
   \end{itemize}
\end{itemize}

\clearpage
\noindent
{\bf (2) Kohonen's Self-organizing Network:}\\

\noindent
Simulation of topology preserving maps in the brain.

\begin{itemize}
\item Kohonen Learning Algorithm
   \begin{itemize}
   \item[]The $n$-dimensional weight vectors $w_1,..,w_m$ of the m computing
     neurons are selected at random. 
     An initial radius $r$, 
     a learning constant $\eta$, 
     and a neighborhood funciton $\phi$ are selected.\\
   \item[1.] Select an input vector $\zeta$ using the desired 
             probability distribution over the input space.\\
   \item[2.] The neuron $k$ with the maximum excitation is selected,
             that is, for which the distabnce between $w_i$ and $\zeta$ 
             is minimal for $i=1,\cdots,m$.\\
   \item[3.] The weight vectors are updated using the nighborhood function 
             and the update rule\\
   \begin{equation}
   w_i=w_i+ \eta \phi(i,k)(\zeta - w_i) \mbox{for} i=1,\cdots,m 
   \end{equation}
   \item[]
   \item[4.]  Stop if the maximum number of iterations has been reached, 
              otherwise modify $\eta$ and $\phi$ as sceduled and continue 
              with step 1.
   \end{itemize}
\clearpage
\item Examples:
   \begin{itemize}
   \item[] (i) from 2D to 1D
      \begin{itemize}
      \item points inside of a triangle in 2-dimensional space into 11 
            classes two inputs for x1,x2 representing coordinate eleven 
            outputs corresponding to (wi1,wi2) which is closest to 
            the (x1,x2) will be on
      \item plot (w,w)
      \end{itemize}
   \item[] (ii) from 2D to 2D
   \end{itemize}
\end{itemize}

\clearpage
\noindent
{\bf (3) Unsupervised Reinforcement Learning}\\

\begin{itemize}
\item Assume that a set of empirical data is given which consists of 
      the $n$-dimensional vectors $(x_1,\cdots, x_m)$.
\item {\it The first principal component} of this set of vectors is 
       a vector {\bf w} which maximizes
\begin{equation}
\frac{1}{m} \sum_{i=1}^m \| w_i x_i \| ^2
\end{equation}
\item The second principal component is computed by subtracting from each 
      vector $x_i$ its projection on the first principal component.
\item[]
\item architecture
   \begin{itemize}
   \item $n$ input neurons which are given $x_1, \cdots, x_n$
   \item one ouput neuron which receives
   \begin{equation}
   \sum_{i=1}^n w_i x_i
   \end{equation}
   \end{itemize}
\item Algorithm --- Computation of the first principal component
   \begin{itemize}
   \item Let {\bf x} be a $n$-dimensional vector.
   \item The vector {\bf w} is initialized randomly ($w_{i} \ne 0$).
   \item A learning constant $\gamma$ with $0<\gamma \le 1$ is selected.
   \item A vector x is selected randomly from x
   \item The scalar product $\phi=xw$ is computed
         the new weight vector is $w + \gamma \phi (x - \phi w)$
   \item go to update making $\gamma$ smaller. 
   \end{itemize}
\end{itemize}

\end{LARGE}
\end{document}

