Code a Perceptron from Scratch
A neuron in a few lines of Python.
What Is a Perceptron
A perceptron is one neuron plus a learning rule. It is the original trainable building block of neural networks, and you can code it from scratch. 🛠️
Start with Weights
First create the weights and a bias. Starting them at zero is fine for a perceptron; learning will move them where they need to be.
weights = [0.0, 0.0]
bias = 0.0All lessons in this course
- Weights, Bias & the Weighted Sum
- The Step Function & Linear Decisions
- Code a Perceptron from Scratch
- The XOR Problem: Why One Neuron Isn't Enough