# Perceptron Training Algorithm

(Redirected from Perceptron Algorithm)

A Perceptron Training Algorithm is a linear supervised model-based binary classification algorithm that is used to train a perceptron network.

## References

### 2011

• (Wikipedia, 2011) ⇒ http://en.wikipedia.org/wiki/Perceptron#Learning_algorithm
• Below is an example of a learning algorithm for a single-layer (no hidden layer) perceptron. For multilayer perceptrons, more complicated algorithms such as backpropagation must be used. Alternatively, methods such as the delta rule can be used if the function is non-linear and differentiable, although the one below will work as well.

The learning algorithm we demonstrate is the same across all the output neurons, therefore everything that follows is applied to a single neuron in isolation. We first define some variables:

• $\displaystyle{ y = f(\mathbf{z}) \, }$ denotes the output from the perceptron for an input vector $\displaystyle{ \mathbf{z} }$.
• $\displaystyle{ b \, }$ is the bias term, which in the example below we take to be 0.
• $\displaystyle{ D = \{(\mathbf{x}_1,d_1),\dots,(\mathbf{x}_s,d_s)\} \, }$ is the training set of $\displaystyle{ s }$ samples, where:
• $\displaystyle{ \mathbf{x}_j }$ is the $\displaystyle{ n }$-dimensional input vector.
• $\displaystyle{ d_j \, }$ is the desired output value of the perceptron for that input.
• We show the values of the nodes as follows:
• $\displaystyle{ x_{j,i} \, }$ is the value of the $\displaystyle{ i }$th node of the $\displaystyle{ j }$th training input vector.
• $\displaystyle{ x_{j,0} = 1 \, }$.
• To represent the weights:
• $\displaystyle{ w_i \, }$ is the $\displaystyle{ i }$th value in the weight vector, to be multiplied by the value of the $\displaystyle{ i }$th input node.
• An extra dimension, with index $\displaystyle{ n+1 }$, can be added to all input vectors, with $\displaystyle{ x_{j,n+1}=1 \, }$, in which case $\displaystyle{ w_{n+1} \, }$ replaces the bias term.

To show the time-dependence of $\displaystyle{ \mathbf{w} }$, we use:

• $\displaystyle{ w_i(t) \, }$ is the weight $\displaystyle{ i }$ at time $\displaystyle{ t }$.
• $\displaystyle{ \alpha \, }$ is the learning rate, where $\displaystyle{ 0 \lt \alpha \leq 1 }$.
• Too high a learning rate makes the perceptron periodically oscillate around the solution unless additional steps are taken.

### 2009

    Sample: (xi,ti), ti in {-1,+1}
If  ti <wk,xi>  < 0 THEN  /* Error*/
wk+1 = wk + ti xi
k=k+1
until (error==false)
return k,(wk,bk)   where k is the number of mistakes


.