Problem: Given 3 Binary Inputs (X[0], X[1], X[2]), Produce the Desired Binary Output (Out)
000
001
010
011 Trainable Values are 0 and 1
100
101
110
111
(A stack overflow result indicates the solution is linearly inseperable - try another combination)
MCP Perceptron Solution to Problem: Trainning Itterations:
(X[0])---(W[0]=)----\
(X[1])---(W[1]=)---- (TH=)------(Out)
(X[2])---(W[2]=)----/
activation = X[0]*W[0] + X[1]*W[1] + X[2]*W[2] (X[i] ==> i-th Input, W[i] ==> i-th Weight)
Out = 1 iff activation > Threshold (Out ==> Perceptrons Output value, TH ==> threshold value)
Out = 0 iff activation <= Threshold MCP --> McCulloch-Pitts Perceptron. A very basic artificial neural node capable of learning linearly seperable binary solvable problems
Quick Study - What goes into making a Perceptron
The Perceptron can accept N inputs
It has only 1 output
It has 1 distinct Weight associated with each distinct input
The percptron has a Threshold Value that is used like a potential barrier
Along with the above, the following are required for the perceptron to be brought to life...
The perceptron needs to be able to calculate its response to any given input.
It needs to be able to track any error in its output (for trainning purposes)
It needs to be able to adjust its own weights in reponse to erroneous outputs
It needs a way to store its state
It needs a way to present the result of calculations
--Details by Example (Lets use a 3 input perceptron)---
First the perceptron starts with random values for weights and threshold.
For the example the initial values will be W[0]=0.2, W[1]=0.8, W[2]=0.5, and Th=-0.05
And we want the input vector (0,0,0) to produce a result of 1
So... include the Array (0,0,0) in the trainning set with an associated desired output of 0
(View this pages source and look at function init() for implementation details)
-- Train the perceptron --
Here is how the perceptron responds --
It accepts the set of trainning vectors and the associated output vector
For each input vector, it goes through the following steps
Use each distinct coordinate value of the input vector as an input value for the perceptron
How: 3 inputs = X[0], X[1], X[2]. Input Vector = (0,0,0) So X[0]=0, X[1]=0, X[2]=0 (for first input vector)
Calulate the value of adjusted inputs (The activation value)
How: Multiply each input by it associated weight, and sum the results
activation = X[0]*W[0] + X[1]*W[1] + X[2]*W[2] ==> (0*0.2 + 0*0.8 + 0*0.5 = 0)
Compare the calulated actvation value with the perceptron threshold value
How: (activation = 0) > (threshold =-.05)
When the activation is above the threshold, the perceptron is excited and it fires (value=1)
When the activation is lower than the threshold, the perceptron is NOT excited (value=0)
Since the activation is above the threshold the current value of the perceptron is 1 (indicating an excited perceptron).
Compare the perceptron value to the desired output value
How: We want the output to be a 0, but it is a 1 - Oops.
The perceptron will now train itself to produce the correct output using the Perceptron Trainning Rule
The Perceptron Trainning Rule
If the output is correct, the perceptron will do nothing
If the output is wrong and the perceptron is excited (value=1)
SUBTRACT 1 from every weight that has an associated input of 1
Ignore all weights that have an associated input of 0
ADD 1 to the threshold value
If the output is wrong and the perceptron is NOT excited (value=0)
ADD 1 to every weight that has an associated input of 1
Ignore all weights that have an associated input of 0
SUBTRACT 1 from the threshold value
Repeat the process (1-5) for each input vector and desired ouput value in the trainning set
Continue the process untill there are no output errors
Thats every thing I can think of at the moment...
If you make an object that incorporates all of the above - you have a perceptron.
By Robert Spoons 2003 - 60 years after the MCP perpectrons birth (where does time go?)