Perceptron Learning Algorithm
The algorithm for Perceptron Learning is based on the supervised learning procedure discussed previously. This algorithm can be coded in any programming language, and in the case of this tutorial, Java for the applets.
Algorithm:
Initialise weights and threshold.
Set wi(t), (0 <= i <= n), to be the weight i at time t, and ø to be the threshold value in the output node. Set w0 to be -ø, the bias, and x0 to be always 1.
Set wi(0) to small random values, thus initialising the weights and threshold.
Present input and desired output
Present input x0, x1, x2, ..., xn and desired output d(t)
Calculate the actual output
y(t) = fh[w0(t)x0(t) + w1(t)x1(t) + .... + wn(t)xn(t)]
Adapts weights
wi(t+1) = wi(t) + ñ[d(t) - y(t)]xi(t) , where 0 <= ñ <= 1 is a positive gain function that controls the adaption rate.
Steps iii. and iv. are repeated until the iteration error is less than a user-specified error threshold or a predetermined number of iterations have been completed.
Please note that the weights only change if an error is made and hence this is only when learning shall occur.
Previous:- Perceptron Learning Theory
Next:- Example 2: Binary Logic Unit