Lion Cipher Lab

Build a neural network from scratch

Why it matters

Neural networks power most of the AI people now interact with daily, and for almost everyone they are a black box: numbers go in, an answer comes out, and the middle is magic. It is not magic. A neural network is a stack of very simple operations -- multiply some numbers, add them up, bend the result, measure how wrong you were, and nudge the numbers to be less wrong -- repeated until the output is useful. The fastest way to stop fearing the box is to build the smallest possible one yourself, with no framework hiding the steps, and watch it teach itself something a single layer provably…

What you'll learn

Steps in this lab

  1. What a neuron actually is
  2. Install numpy, offline after this
  3. The forward pass: run one neuron by hand
  4. Why XOR needs a hidden layer
  5. Loss: putting a number on how wrong we are
  6. Gradient descent and backpropagation, in plain terms
  7. Train it on XOR and watch the loss drop
  8. The honest limits, and what to do with this

Open the full interactive lab →