How to use the Backpropagation Calculator
- 1. Enter the networkGive inputs, targets, hidden and output weights and biases, and the learning rate.
- 2. Pick activationsChoose sigmoid, tanh, ReLU or linear for the hidden and output layers.
- 3. Run itSee every neuron's value, the error, each gradient and the new weights.
The steps
The forward pass computes each neuron's net input (weighted sum plus bias) and output (activation). The error is E = Σ ½(target − output)². Backpropagation then applies the chain rule. Each output neuron's delta is (output − target) × f′(net), and each hidden neuron's delta is the sum of the output deltas weighted by its connections, times its own f′(net). Every gradient is a delta times the activation feeding that weight, and every weight moves by −η × gradient.
Worked example
The defaults are the well-known 2–2–2 sigmoid example: inputs 0.05 and 0.10, targets 0.01 and 0.99, η = 0.5. The forward pass gives hidden outputs 0.59326999 and 0.59688438, and network outputs 0.75136507 and 0.77292847, for a total error of 0.29837111. The weight from h1 to o1 has gradient 0.08216704 and is updated from 0.40 to 0.35891648. The first input weight goes from 0.15 to 0.14978072. Train for 10,000 steps on this one example and the error falls to 0.00000245.
How we checked it
- Gradients match finite-difference estimates (nudging each weight slightly) on 60 random networks.
- The default example reproduces the published numbers to 8 decimals.
- Biases are updated too; some textbook versions keep them fixed, so their later numbers may differ slightly.
Frequently asked questions
Why use ½ in the error?
It cancels the 2 that appears when you differentiate the square, so the gradient is simply (output − target).
Can I use cross-entropy loss?
This tool uses squared error. With a sigmoid output and cross-entropy, the output delta simplifies to (output − target).
Is the backpropagation calculator free?
Yes. You can open the backpropagation calculator and enter everything without signing up. When you run a pass for the first time, we ask once for your name and WhatsApp number; after that it, and every other Uncodemy tool, opens straight away.