Hi… guys :) For this time I want to tell you about Perceptron Algorithms to solve an Artificial Neural Network (ANN) problem. For example we will make an ANN model to know the XOR statement target as below.
Input | Target |
X1 | X2 | t |
1 | 1 | -1 |
1 | 0 | 1 |
0 | 1 | 1 |
0 | 0 | -1 |
We need to finish it with α=0.6 , b=0.2 , w1 (weight of x1) = 0.3 , w2= - 0.2 , and θ=0.7
The formula of Perceptron Algorithms as follows:
· θ is a threshold of activation function to calculating the output of Perceptron Algorithms.
· Xi is input of ANN
· t is the target of ANN
· wi (w1,w2,…,wn) is weight of input Xi
· b is bias of input an ANN
· net = S xiwi + b
· α is learning rate of Perceptron
· Activation Function y=f(net) = 1 , if net > θ ; 0 , if - θ ≤ net ≤ θ ; -1 , if net ≤ - θ
· Dwi = α t xi
· Db = α t
· wi (new) = wi (old) + Dwi
· b (new) = b (old) + Db
Okay , then we try to calculate the Perceptron Algorithms as follows :
The 1st Iteration
Input | Target | net | Output f(net) | Change of weight | weight |
X1 | X2 | t | Dw1 | Dw2 | Db | w1 | w2 | b |
1 | 1 | -1 | -0.3 | -1 | 0 | 0 | 0 | 0.3 | -0.2 | 0.2 |
1 | 0 | 1 | 0.5 | 0 | 0.6 | 0 | 0.6 | 0.9 | -0.2 | 0.8 |
0 | 1 | 1 | 0.6 | 0 | 0 | 0.6 | 0.6 | 0.9 | 0.4 | 1.4 |
0 | 0 | -1 | -1.4 | -1 | 0 | 0 | 0 | 0.9 | 0.4 | 1.4 |
Note : if t = y then fill the value of Dwi and Db by Nol
The 2nd Iteration
Input | Target | net | Output f(net) | Change of weight | weight |
X1 | X2 | t | Dw1 | Dw2 | Db | w1 | w2 | b |
1 | 1 | -1 | -2.7 | -1 | 0 | 0 | 0 | 0.9 | 0.4 | 1.4 |
1 | 0 | 1 | 2.3 | 1 | 0 | 0 | 0 | 0.9 | 0.4 | 1.4 |
0 | 1 | 1 | 1.8 | 1 | 0 | 0 | 0 | 0.9 | 0.4 | 1.4 |
0 | 0 | -1 | -1.4 | -1 | 0 | 0 | 0 | 0.9 | 0.4 | 1.4 |
so the conclusion is the Perceptron algorithm can solve ANN Problem (XOR Statement) with α=0.6 , b=0.2 , w1 (weight of x1) = 0.3 , w2= - 0.2 , and θ=0.7 on the 2nd Iteration.
Read More