See how tiny weight changes turn wrong predictions into useful ones.
A neural network learns by changing numbers called weights. It makes a prediction, measures how wrong that prediction is, then adjusts the weights to reduce the error. Repeating this process across many examples gradually shapes the network into a useful model.
Data enters the network as numbers. Each connection multiplies its input by a weight, and a neuron combines those results with a bias. An activation function may then transform the result before the next layer receives it.
After the forward pass, compare the prediction with the target. A loss function turns that difference into one number. For a simple regression neuron, half the squared error is useful because large mistakes count more and the curve has a smooth slope.
The gradient tells you how the loss changes when a weight changes. For one neuron with prediction y hat equals w times x plus b, the weight gradient is prediction minus target, multiplied by x. Subtract a small learning rate times this gradient from the old weight.
Training repeats the same loop: calculate predictions, calculate loss, find gradients with backpropagation, and update weights. One update usually changes many weights at once. A batch uses several examples before updating, which can make the direction less noisy.
A small training loss does not guarantee useful predictions. A network can memorise its training examples and still fail on new data; this is overfitting. Keep validation data separate, and remember that weights learn patterns from data rather than understanding meaning like a person.