What is a Perceptron?
A perceptron
is a simple model of an artificial neuron that outputs either 0 or 1 based on the input signals.
1. Structure of a Perceptron
Like other artificial neurons, a perceptron consists of input
, weights
, bias
, activation function
, and output
.
The perceptron calculates the output value by applying the activation function to the sum of the product of input values and weights, added to the bias.
The operation of a perceptron can be expressed by the following equation:
Where each symbol represents the following:
- : Input value
- : Weight
- : Bias
- : Activation function
- : Output value
2. Operation of a Perceptron
The perceptron outputs 1 (true, activated)
if the sum of the product of the given input values and weights exceeds a certain threshold, otherwise it outputs 0 (false, deactivated)
.
This method of producing one of two possible values (e.g., true/false, 0/1) is called Binary Classification
, and a perceptron that performs binary classification in a single layer is called a single-layer perceptron
.
Using a single-layer perceptron, you can create simple rules to compare two input values.
For example, the perceptron below outputs 1
only when both input values are 1 (true)
, and 0
in all other cases.
Input Value 1 () | Input Value 2 () | Output () |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
This rule, where the output is 1 only when all input values are 1, is known as the AND operation
.
Now, consider a perceptron where the result is 1 if at least one input value is 1
.
Input Value 1 () | Input Value 2 () | Output () |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
This rule, where the output is 1 if at least one input value is 1, is known as the OR operation
.
In the next lesson, we will explore the limitations of single-layer perceptrons and delve into multi-layer perceptrons that overcome these limitations.
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.