Building makemore Part 4: Becoming a Backprop Ninja
We take the 2-layer MLP (with BatchNorm) from the previous video and backpropagate through it manually without using PyTorch autograd’s (): through the cross entropy loss, 2nd linear layer, tanh, batchnorm, 1st linear layer, and the embedding table. Along the way, we get a strong intuitive understanding about how gradients flow backwards through the compute graph and on the level of efficient Tensors, not just individual scalars like in micrograd. This helps build competence and intuition around how neural nets are optimized and sets you up to more confidently innovate on and debug modern neural networks.
!!!!!!!!!!!!
I recommend you work through the exercise yourself but work with it in tandem and whenever you are stuck unpause the video and see me give away the answer. This video is not super intended to be simply watched. The exercise is here:
!!!!!!!!!!!!
Links:
- makemore on github:
- jupyter notebook I built in this video:
- collab notebook:
- my website:
- my twitter:
- our Discord channel:
Supplementary links:
- Yes you should understand backprop:
- BatchNorm paper:
- Bessel’s Correction:
- Bengio et al. 2003 MLP LM
Chapters:
00:00:00 intro: why you should care & fun history
00:07:26 starter code
00:13:01 exercise 1: backproping the atomic compute graph
01:05:17 brief digression: bessel’s correction in batchnorm
01:26:31 exercise 2: cross entropy loss backward pass
01:36:37 exercise 3: batch norm layer backward pass
01:50:02 exercise 4: putting it all together
01:54:24 outro
0 views
152
33
8 months ago 00:27:33 0
Building a sub 250g Autonomous Drone with Ardupilot and ExpressLRS AirPort Telemetry
8 months ago 00:29:28 0
Hard Work to Build Underground House with Private Underground Living King Room and Swimming Pool
8 months ago 00:30:54 0
The South America Tank: EPIC Aquascape Tutorial w/ Electric Blue Acara
8 months ago 00:00:00 0
SMB Hack Longplay - Mario Adventure 3
9 months ago 01:04:22 0
Walking in Shenzhen at night, amazing night view, the most beautiful city in China | 4K HDR
9 months ago 00:15:32 1
How to Edit Curved or Round wall in Revit ( Revit Tutorial )
9 months ago 00:21:58 0
Primitive Technology: A-frame Roof Tile Factory
9 months ago 00:00:00 0
Sonic Hack Longplay - Superstars Amy Rose in Sonic the Hedgehog (SHC 2024)
9 months ago 00:07:37 0
Mini Van to truck build
9 months ago 00:19:39 0
The Allure of Private Underground Homes with Swimming Pools
9 months ago 01:03:42 0
The Future of Intel
9 months ago 00:05:17 1
MACKLEMORE - HIND’S HALL 2 feat. Anees, MC Abdul, Amer Zahr (LYRIC VIDEO)
9 months ago 00:07:16 1
Делаем мини-сферу из Лас Вегаса / Building a Mini Vegas-Sphere
9 months ago 00:48:32 1
Elon Musk’s Father Exposes The Truth About Elon Musk & Donald Trump