The opening lecture of the course. Watch it for the starting picture of a neural network as units that take a weighted sum and apply a threshold, before you build logic gates from such units here.
COURSE / REAL PRACTICE
Deep learning 1: training a network
Watch lectures 1 to 8 of CMU’s public 11-785 course, then build what they derive in NumPy: threshold networks, cross-entropy, gradient descent, backpropagation, momentum, Adam, batch normalization and dropout. Every build is graded against PyTorch or an exact check. Unofficial practice material, not affiliated with CMU.
Read the explanation and diagrams, then work through the practice. Your browser profile supplies your saved progress.
What you’ll work toward
Train a multilayer classifier with your own NumPy code: backpropagation, mini-batches, Adam and weight decay, with every update checked against PyTorch’s and the best weights chosen on held-out data.
Read an explanation, inspect the diagrams and work through the available checks, debugging exercises and builds. Feedback and prerequisite links guide the next step.
Before you start
This course builds on these skills:
Individual lessons can add prerequisites. Your lesson progress shows your actual readiness.
A look inside the first lesson
Perceptrons, Boolean logic and depth
import itertools
def unit(w, b, x):
return int(sum(wi * xi for wi, xi in zip(w, x)) + b >= 0)
inputs = [(0, 0), (0, 1), (1, 0), (1, 1)]
print("AND", [unit((1, 1), -2, x) for x in inputs])
print("OR ", [unit((1, 1), -1, x) for x in inputs])
print("NOT", [unit((-1,), 0, (v,)) for v in (0, 1)])
grid = [v / 2 for v in range(-6, 7)] # -3.0 to 3.0 in steps of 0.5
xor = [0, 1, 1, 0]
hits = sum(
[unit((w0, w1), b, x) for x in inputs] == xor
for w0, w1, b in itertools.product(grid, repeat=3)
)
print("settings tried:", len(grid) ** 3, "that give XOR:", hits)Your lesson sequence
Follow the same units and lessons in either view. Prerequisite links and your practice progress stay with each lesson.
What a network computes
- LESSON 01.01
Perceptrons, Boolean logic and depth
Threshold units as logic gates, why XOR needs a hidden layer, and a construction that turns any truth table into a two-layer network.
Open lesson - LESSON 01.02
Empirical risk, softmax and cross-entropy
Why training minimizes an average loss over samples, why that loss cannot be the error count, and a stable softmax cross-entropy with its gradient.
Open lesson
Learning by gradient
- LESSON 02.01
Gradient descent on a classifier
Turn a gradient into a training loop: batch gradient descent on softmax regression, with the loss recorded before every step.
Open lesson - LESSON 02.02
Backpropagation through an MLP
Cache the forward pass, push the loss derivative back through softmax cross-entropy, linear layers and activations, and prove every gradient two independent ways.
Open lesson
Making training converge
- LESSON 03.01
Learning rates, momentum and Nesterov
Why a step size above 2/L diverges on a quadratic bowl, and how momentum and Nesterov lookahead speed up the slow directions of a ravine.
Open lesson - LESSON 03.02
Mini-batches, RMSProp and Adam
What a mini-batch gradient estimates, and Adam: momentum plus a per-parameter step size with bias correction, matched step for step against PyTorch.
Open lesson - LESSON 03.03
Batch normalization and dropout
Two layers that behave differently in training and evaluation: batch statistics versus running averages, and inverted dropout that keeps the expected activation.
Open lesson
WATCH ALONG
Videos for these lessons
One hand-picked talk, lecture or tutorial per lesson, in course order. They play here when you press play; nothing loads from the video provider before that.
8 videos· 11 h 25 min
01Perceptrons, Boolean logic and depth
02Empirical risk, softmax and cross-entropy
The lecture this lesson is built around: learning a network by minimizing a loss averaged over training samples, and the choice of a differentiable divergence between output and target. Watch it first, then build the loss and its gradient here.
03Gradient descent on a classifier
The lecture this lesson is built around: minimising a loss by following its gradient, and how the update rule is applied step after step. Watch it first, then write the training loop for a linear classifier yourself.
04Backpropagation through an MLP
The lecture this lesson is built around: the forward pass, the backward pass and the calculus of backpropagation for vector activations. Watch it first, then implement the same recursion here and check it against finite differences and autograd.
05Learning rates, momentum and Nesterov
The lecture this lesson is built around: how the choice of step size and the shape of the loss surface govern gradient descent, and the momentum and Nesterov fixes. Watch it first, then build the three update rules here and measure them.
06Mini-batches, RMSProp and Adam
Paired lecture on how training moves from full-batch gradient descent to stochastic and mini-batch updates. Watch it first, then build the epoch shuffler and check what a mini-batch gradient estimates.
07Batch normalization and dropout
The lecture this lesson is built around: normalizing activations with batch statistics, and regularizing with dropout. Watch it first, then build both layers here and compare them with PyTorch.
08Capstone: train a classifier end to end
The recorded lab session that the schedule lists as a first MLP in code. Watch it before you start, then assemble the same kind of program here: a forward pass, a loss, gradients and a training loop.