Neural Networks from Scratch

Forward pass, backward pass and a working network in NumPy before you are allowed to import a framework.

Module 04.1 · Intermediate
Free

12h · 8 lessons · 1 challenge

Before this: Calculus & Optimization, Classification & Logistic Regression

About this module

You write the whole thing: layers, activations, loss, backward pass, training loop, in NumPy. Then you reproduce it in PyTorch and confirm the gradients agree.

The point is that no part of a framework stays mysterious. Candidates who have done this can answer "what does .backward() actually do" in a way that ends the question, and they debug training failures far faster.

After this module you can

8 lessons

Lesson 1
Neurons, layers and the forward pass
Kind
Concept
Length
50 min
Lesson 2
Activations: what each nonlinearity buys
Kind
Concept
Length
45 min
Lesson 3
Backpropagation through a network, by hand
Kind
Concept
Length
60 min
Lesson 4
Build the network in NumPy
Kind
Lab
Length
120 min
Lesson 5
Gradient checking and finding the bug
Kind
Lab
Length
60 min
Lesson 6
The same network in PyTorch
Kind
Lab
Length
70 min
Lesson 7
Layer Lab: assemble a net that hits the target
Kind
Interactive
Length
40 min
Lesson 8
Checkpoint: trace the gradient
Kind
Checkpoint
Length
30 min

The challenge: Layer Lab

A target accuracy and a parameter budget. Assemble layers, pick activations, train, iterate. Fewest parameters wins.

Worth 600 XP.

Related modules

All modules
Making Deep Networks Train
10h · 8 lessons
Structuring ML Projects
8h · 8 lessons