Choose the truth you want it to learn.
| Input | Target | Prediction | Class |
|---|
Initialize weights. Run the forward pass. Backpropagate the error. Watch a neural network learn, one honest update at a time.
Every number below comes from a real 2-2-1 network running in your browser. Change the task, inspect the state, and train it yourself.
| Input | Target | Prediction | Class |
|---|
A language model is vast, but its learning loop still rhymes with this: predict, measure the error, move the parameters, repeat.
Hover or focus a stage to open it. The same chain rule that trains this tiny network scales into the systems AI engineers build on every day.
Two binary features enter as x₀ and x₁. The network sees numbers, never the human name of the logical rule.
Each hidden neuron computes a weighted sum and sigmoid activation. The output neuron combines those activations into a probability.
Binary cross-entropy turns the distance between prediction and target into one scalar objective. Lower is better.
The chain rule assigns responsibility to every weight. Gradient descent moves each parameter in the direction that reduces loss.
Frameworks compress these operations. Understanding them expands your ability to debug, design, and reason.
h = sigmoid(W₁x + b₁)
ŷ = sigmoid(W₂h + b₂)L = -[y log(ŷ) + (1-y) log(1-ŷ)]
dL/dz₂ = ŷ - y∂L/∂W₂ = dz₂ · h
∂L/∂W₁ = (W₂ᵀdz₂ ⊙ h(1-h)) · xTrain it, break it, reset it, and export the trace. First principles become useful when you can see every step.
Run the network