Deep Learning · Step 1 of 8 · 10 min
Neural networks, intuitively
You can explain neurons, layers, loss, gradient descent and backpropagation in plain words.
A neuron is a small sum
An artificial neuron takes some numbers, multiplies each by a weight, adds them up, adds a bias, and passes the result through a simple function called an activation. That is all. One neuron can only draw a straight line between two groups.
The activation matters. Without it, stacking neurons would still give you a straight line. A common choice is ReLU: keep the number if it is positive, otherwise output zero. That small bend lets many neurons together draw curved, complex boundaries.
Layers turn simple into rich
A layer is a row of neurons that all read the same input. A network is layers in sequence: the output of one is the input of the next. "Deep" just means many layers.
Early layers learn simple patterns. Later layers combine them into richer ones. In an image model, the first layer may react to edges, a middle layer to eyes and wheels, a late layer to faces and cars. Nobody programs this. It emerges from training.
Loss tells the network how wrong it is
Training starts with random weights, so the first predictions are nonsense. A loss function turns each mistake into one number: high when the prediction is far off, low when it is close. For classification, the usual choice is cross-entropy. For predicting a number, mean squared error.
The whole goal of training is to find weights that make the average loss small on examples the network has not seen.
Gradient descent and backpropagation
Picture the loss as a hilly landscape and the weights as your position. The gradient points uphill. Gradient descent takes a small step the other way, again and again. The size of the step is the learning rate: too big and you overshoot, too small and you crawl.
Backpropagation is how the network computes that gradient for millions of weights at once. It works backwards from the loss, layer by layer, using the chain rule from calculus. Frameworks like PyTorch do this for you automatically. You still need the intuition to debug.
Try it
Train a tiny network in your browser
- 1.Open TensorFlow Playground at playground.tensorflow.org.
- 2.Pick the spiral dataset. Start with one hidden layer of two neurons and press play. Watch it fail.
- 3.Add layers and neurons until the boundary wraps around the spiral. Then raise the learning rate to 3 and watch training become unstable.
- 4.Switch the activation from ReLU to Linear and notice that no amount of layers can solve the spiral.