The spelled-out intro to neural networks and backpropagation: building micrograd
This is the most step-by-step spelled-out explanation of backpropagation and training of neural networks. It only assumes basic knowledge of Python and a vague recollection of calculus from high school.
Links:
- micrograd on github:
- jupyter notebooks I built in this video:
- my website:
- my twitter:
- “discussion forum“: nvm, use youtube comments below for now :)
- (new) Neural Networks: Zero to Hero series Discord channel: , for people who’d like to chat more and go beyond youtube comments
Exercises:
you should now be able to complete the following google collab, good luck!:
Chapters:
00:00:00 intro
00:00:25 micrograd overview
00:08:08 derivative of a simple function with one input
00:14:12 derivative of a function with multiple inputs
00:19:09 starting the core Value object of micrograd and its visualization
00:32:10 manual backpropagation example #1: simple expression
00:51:10 preview of a single optimization step
00:52:52 manual backpropagation example #2: a neuron
01:09:02 implementing the backward function for each operation
01:17:32 implementing the backward function for a whole expression graph
01:22:28 fixing a backprop bug when one node is used multiple times
01:27:05 breaking up a tanh, exercising with more operations
01:39:31 doing the same thing but in PyTorch: comparison
01:43:55 building out a neural net library (multi-layer perceptron) in micrograd
01:51:04 creating a tiny dataset, writing the loss function
01:57:56 collecting all of the parameters of the neural net
02:01:12 doing gradient descent optimization manually, training the network
02:14:03 summary of what we learned, how to go towards modern neural nets
02:16:46 walkthrough of the full code of micrograd on github
02:21:10 real stuff: diving into PyTorch, finding their backward pass for tanh
02:24:39 conclusion
02:25:20 outtakes :)
5 views
7
2
4 days ago 00:03:53 1
This Tiny SanDisk CFexpress Card Is Faster Than Your SSD?! The 480GB Beast for 8K Shooters! - YouTube
4 weeks ago 00:31:14 1
I spent 12 HOURS decorating my log flume in Minecraft Create Mod!
2 months ago 00:03:09 1
DWS matrimonial Form Filling auto typing software
2 months ago 00:00:35 1
Thousands Rally Nationwide Against Trump, Calling for Protection of Democracy and Civil Liberties
2 months ago 01:22:06 24
Художественный фильм “Наше сердце“ (1946 г.) / The film “Our Heart“
2 months ago 00:21:14 4
We’re LOSING The Tariff War With China: How Our Elites Sold Us Out
3 months ago 00:21:58 52
On Writing with Sergey & Jill, part 1
3 months ago 00:04:08 1
Annie Lennox - Waiting In Vain (Official Video)
5 months ago 00:03:53 1
Freya Ridings - Lost Without You (Live At Hackney Round Chapel)
5 months ago 00:14:19 1
The BEST Chinese Carbon Road Bike Wheels vs The BEST Western Road Bike Wheels
6 months ago 00:30:52 1
30 КООПЕРАТИВНЫХ ИГР в 2024!
6 months ago 00:01:27 5
4K DOOM 1993/2024 || AI reimagined, generated || 50FPS
6 months ago 00:10:03 1
SHOCK Confession Of New Syrian Leader Triggers Global Alarm!
6 months ago 00:04:02 1
Kawasaki Ninja Bike Top Speed 400 km/h - Record Breaking Speed - Motorcycle Review
6 months ago 00:31:34 1
DEATHGRIP CHALLENGE - UNLIMITED SPEED NO BRAKES!!
6 months ago 00:06:28 1
LeadsGorilla vs. Leads Sniper: Which Lead Generation Tool Wins in 2025? 🏆
6 months ago 00:01:11 1
Carbon - Sunrise
6 months ago 00:05:10 1
How to Invest in Presale Crypto and Maximize Your Profits!