Implementation of Perceptron Algorithm for AND Logic Gate with 2-bit Binary Input
In the field of Machine Learning, the Perceptron is a Supervised Learning Algorithm for binary classifiers. The Perceptron Model implements the following function:
For a particular choice of the weight vector and bias parameter , the model predicts output for the corresponding input vector .
AND logical function truth table for 2-bit binary variables, i.e, the input vector and the corresponding output –
Now for the corresponding weight vector of the input vector , the associated Perceptron Function can be defined as:
For the implementation, considered weight parameters are and the bias parameter is .
AND(0, 1) = 0 AND(1, 1) = 1 AND(0, 0) = 0 AND(1, 0) = 0
Here, the model predicted output () for each of the test inputs are exactly matched with the AND logic gate conventional output () according to the truth table for 2-bit binary input.
Hence, it is verified that the perceptron algorithm for AND logic gate is correctly implemented.
Attention reader! Don’t stop learning now. Get hold of all the important Machine Learning Concepts with the Machine Learning Foundation Course at a student-friendly price and become industry ready.