Lion Cipher Lab
Build a neural network from scratch
- AI Security
- Intermediate
- ~60 min
- Free · no account required
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
- what a neuron actually computes (weighted sum plus activation)
- building a 1-hidden-layer network in plain numpy
- running a forward pass by hand
- measuring error with a loss function (MSE)
- gradient descent and backpropagation in plain terms
- training a network to learn XOR
- watching loss drop as the network learns
- why a single layer cannot solve XOR and a hidden layer can
- knowing when to reach for a real framework instead
Steps in this lab
- What a neuron actually is
- Install numpy, offline after this
- The forward pass: run one neuron by hand
- Why XOR needs a hidden layer
- Loss: putting a number on how wrong we are
- Gradient descent and backpropagation, in plain terms
- Train it on XOR and watch the loss drop
- The honest limits, and what to do with this