Machine Learning Engineering · Module 09
Neural networks
- Lessons
- 11
- Free
- 1
- Reading
- ~3 h
Your progress
0 / 11 lessons done
Sign in to trackLessons
- Neurons and layers: the building blocksFreeEvery neural network, from a 225-parameter churn model to a photo classifier, is built from the same two parts: a weighted sum and a bend. Knowing what each layer computes, what shape its weights have and how many numbers it adds is what lets you read, size and debug any network you meet.
- Activation functions: adding non-linearityEvery hidden layer you build or read has an activation, and it decides both what the layer can express and whether training can move its weights. Knowing the few common ones, and how each fails, lets you spot a dead layer or a wrong output before you spend a day tuning.
- Backpropagation: how neural networks learnEvery network you train runs a backward pass on every step. Knowing what each layer computes on the way back, and what it needs from the way forward, is how you read zero gradients, silent shape bugs and steps that change size when the batch does.
- Building a neural network in PyTorchAlmost every PyTorch project you open has the same five parts: data, model, loss and optimizer, a train-and-check loop and a saved weights file. Knowing what each part owns lets you read someone else’s notebook, swap one part without breaking the rest, and spot the lines that fail without an error.
- Weight initialization and unstable gradientsA deep network can fail before its first update: with the wrong starting weights, the signal fades or blows up layer by layer, and no learning rate fixes it. Checking the spread at step 0 takes one forward pass and saves a wasted training run.
- Batch and layer normalizationMost deep networks you train or fine-tune contain a normalization layer, and the most common bug they cause is silent: a model that scores well in the notebook gives different answers in production because one layer still thinks it is training. Knowing what each layer averages over lets you choose one and catch that bug.
- Dropout and other ways to regularize networksAny network big enough to be useful can memorise its training data, and in PyTorch the usual fixes are one layer or one argument each. Knowing what dropout and AdamW’s weight decay do inside lets you pick one, set its strength, and avoid the serving bugs they cause.
- Learning rate schedules and warmupA fixed learning rate leaves the last epochs of a run jittering around the best weights, so which epoch you ship comes down to luck. A schedule that warms up and then decays makes training steadier and the last epoch the one to ship, and it is the default for almost every large network you will train or fine-tune.
- Debugging a network that won’t trainMost broken training runs raise no error: the code runs, the loss prints, and the model learns nothing or learns badly. A short, ordered set of checks finds most of these bugs in minutes, before you spend a day tuning a learning rate that was never the problem.
- Training on GPUs: memory, precision and speedThe first time a network trains on real photos or text, it usually crashes with an out-of-memory error or runs with the GPU idle most of the time. Knowing where memory and time go lets you fix both in a few lines instead of guessing at batch sizes.
- Design: a classifier for product photosMost image models at work are a pretrained network with a new last layer, trained on labels nobody fully trusts. Knowing how to check those labels, judge every class and send the unsure cases to a person matters more than the network’s architecture.