In: Computer Science
Truth table for NAND function |
||
i1 |
i2 |
output |
0 |
0 |
1 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
0 |
First, we need to know that the Perceptron algorithm states that:
Prediction (y`) = 1 if Wx+b > 0 and 0 if Wx+b ≤ 0
Also, the steps in this method are very similar to how Neural Networks learn, which is as follows;
Now that we know the steps, let’s get up and running:
NAND Gate
From the diagram, the NAND gate is 0 only if both inputs are 1.
Row 1
x1(1)+x2(1)-1
0+0-1 = -1
0+0+1 = 1
Row 2
0+1+1 = 2
Row 4
1+1+1 = 3
-1-1+2 = 0
Therefore, we can conclude that neural network to achieve a NAND gate, using the Perceptron algorithm is;
-x1-x2+2