Loading…
Glossary term
One of the earliest neural network units, which combines weighted inputs and produces a single output.
The perceptron, dating from the 1950s, is the simplest neural unit: it multiplies inputs by weights, adds them, and outputs 1 if the total passes a threshold and 0 otherwise.
A single perceptron can only separate data with a straight line, which limited it, but stacking them gave rise to modern networks.
A perceptron in a few lines
def perceptron(x, w, b):
total = sum(xi * wi for xi, wi in zip(x, w)) + b
return 1 if total > 0 else 0
print(perceptron([1, 1], [0.6, 0.6], -1)) # AND gate -> 1It is the historical starting point of neural networks and a good way to see how a unit works.