Read along with the audio summary
When a neural network successfully learns to classify images with high accuracy, are its hidden layers actually picking up on neat, human-like concepts like isolated edges and loops? This episode, which came out on October 16, 2017, explores the fundamental mechanism of how neural networks learn. By the end, you will understand how an algorithm called gradient descent turns machine learning into a practical math problem.
Why machine learning is really just a calculus exercise.
Describing a machine as learning sounds like a crazy sci-fi premise, yet the reality has nothing to do with a computer mysteriously gaining intelligence. Instead, a neural network learning is framed as a mathematical optimization problem. The network has over thirteen thousand parameters, known as weights and biases. The entire goal of learning is simply to find the optimal set of these weights and biases to minimize the network's errors.
To minimize those errors, we first need a way to measure how poorly the network is performing.
How a network scores its own mistakes.
A network cannot improve until it has a clear target to minimize. A mathematical tool called the cost function, also known as the loss function, provides this target by measuring the network's error. For any given training image, the cost function calculates the exact difference between the network's output and the actual correct output. To find the overall cost of the network, it takes the average of all these individual errors across every single training example.
Once the network has this error score, it needs a way to bring that number down.
Finding the fastest way downhill to better performance.
The core algorithm used to minimize the cost function is called gradient descent. It starts by calculating the gradient of the cost function, which is a vector that points toward the steepest increase in cost. By taking a small step in the exact opposite direction of that gradient, the network moves downhill. Repeating this process over and over lets the network iteratively descend toward a local minimum of the cost function, steadily improving its accuracy.
How the network knows which adjustments matter most.
The gradient does not just show the direction of change, it also reveals the relative importance of each individual weight and bias. If a specific component of the gradient has a larger magnitude, adjusting that corresponding weight or bias will have a much more significant impact on lowering the overall cost.
The engine behind the math.
Calculating this massive gradient vector for the cost function requires a specific, efficient algorithm. That algorithm is called backpropagation. It serves as the computational heart of the entire learning process, making it possible to actually compute those thousands of adjustments, which is the subject of the next episode in the series.
Machine learning in neural networks is not about a machine thinking, but about adjusting thousands of parameters to reduce a quantified measure of error through gradient descent. Even when a network learns to classify images with high accuracy, visualizing the pixel patterns that its second-layer neurons pick up on reveals that instead of neat, human-like concepts like isolated edges or loops, the learned patterns look almost random.