0PricingLogin
Deep Learning Academy · Lesson

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.0

All lessons in this course

  1. Weights, Bias & the Weighted Sum
  2. The Step Function & Linear Decisions
  3. Code a Perceptron from Scratch
  4. The XOR Problem: Why One Neuron Isn't Enough
← Back to Deep Learning Academy