Home›Library›AI & Data Science
Curated LibraryNeural Networks from Scratch to GPT in PyTorch
A code-along series that starts with a tiny autograd engine and builds up, step by step, to character-level language models, a Transformer GPT, a BPE tokenizer and a GPT-2 (124M) reproduction. It covers backpropagation, MLPs, initialization, BatchNorm, convolutional architectures, self-attention and training at scale. It suits programmers who know basic Python and are ready to spend many hours reading and writing PyTorch code.
- 10 lessons
- 19h 21m total
- AI & Data Science
- English
- Earns YodaCoins
Curated by YodaHut. These lessons are hosted on YouTube and produced by their original creators, who are not affiliated with YodaHut. You still earn YodaCoins, keep your streak and track progress here.
What You'll Learn
- Implement a scalar autograd engine and compute gradients by hand through neurons and multi-layer perceptrons
- Build and train character-level language models: bigram counts, then embeddings plus an MLP, with minibatches, learning-rate tuning and train/val/test splits
- Diagnose and fix training problems such as bad initial loss, saturated tanh and badly scaled activations and gradients, using Kaiming init and BatchNorm
- Backpropagate manually through cross-entropy, linear layers, tanh and BatchNorm without calling loss.backward()
- Extend an MLP into a deeper WaveNet-style hierarchical model using torch.nn-style layers and containers
- Implement self-attention and a GPT-style Transformer, write a byte-pair-encoding tokenizer, and follow a GPT-2 (124M) reproduction with its training setup
Prerequisites
- Basic Python programming
- Vague high-school calculus (derivatives, chain rule)
- Basic probability helps but is not required
Course Curriculum
10 lessons · 19h 21m- 01Introduction to Neural Networks and Backpropagation: Building micrograd2:25:52
- 02Introduction to Language Modeling: Building makemore (Bigram Model)1:57:45
- 03makemore Part 2: Multilayer Perceptron (MLP)1:15:40
- 04makemore Part 3: Activations, Gradients and BatchNorm1:55:58
- 05makemore Part 4: Manual Backpropagation Through the Network1:55:24
- 06makemore Part 5: Building a WaveNet56:22
- 07Building GPT from Scratch: Self-Attention and Transformers1:56:20
- 08State of GPT: Training Pipeline of GPT Assistants42:40
- 09Building the GPT Tokenizer: Byte Pair Encoding2:13:35
- 10Reproducing GPT-2 (124M)4:01:26
About the Instructor
Andrej Karpathy
YouTube creator
The lessons in this course were produced by Andrej Karpathy and are published on YouTube. YodaHut selected and sequenced them into this course; we did not make them, and Andrej Karpathy is not affiliated with YodaHut.
Visit the channel on YouTubeMore in the Library: AI & Data Science

Time Series Forecasting with Python: ETS, ARIMA, Machine Learning, Deep Learning and Prophet

Time Series Forecasting in Python: ARIMA, VAR, Prophet and LSTM

Time Series Analysis and Forecasting in Python: From Stationarity to ARIMA and SARIMA

ComfyUI Academy: Build Stable Diffusion Workflows from Scratch

ComfyUI for AI Image Generation: Stable Diffusion, Flux, LoRAs, Upscaling and Editing
