Perceptron
AI · Beginner
Definition
A perceptron is the simplest neuron: weighted sum plus bias passed through a step function.
The building block that led to modern neural networks.
Diagram
Flowchart
Example: AND gate
w, b = [1, 1], -1.5
for x in [(0,0), (0,1), (1,0), (1,1)]:
print(int(w[0]*x[0] + w[1]*x[1] + b > 0), end=' ')Output: 0 0 0 1
Key points
- Only learns linearly separable data
- Cannot learn XOR alone
Interview questions
Why can't it learn XOR?
XOR is not linearly separable; you need a hidden layer.