← All books
Book · Intermediate · 50+ hours

Deep Learning from Scratch with PyTorch

From Mathematical Foundations to Production-Ready Models

Master deep learning from mathematical foundations to production-ready models. Cover CNNs, RNNs, Transformers, GNNs, GANs, VAEs, Reinforcement Learning, and more with PyTorch implementations.

37Chapters
179Sections
59hReading
11Parts
Part II·6 chapters · 37 sections

PyTorch BasicsTensors, neural networks, and training.

Part IV·5 chapters · 22 sections

Sequence ModelsRNNs, LSTMs, and attention.

Part VI·3 chapters · 11 sections

Generative ModelsVAEs, GANs, and diffusion.

Generative Adversarial Networks

Adversarial training

4 sections83 min read
Start chapter
  1. 01GAN Framework18m
  2. 02GAN Training Challenges18m
  3. 03Basic GAN Implementation25m
  4. 04GAN Variants22m

Diffusion Models Overview

Brief introduction to diffusion (see Diffusion book for depth)

3 sections45 min read
Start chapter
  1. 01Diffusion Model Intuition15m
  2. 02Mathematical Framework18m
  3. 03Modern Diffusion Systems12m
Part VII·2 chapters · 9 sections

Self-SupervisedContrastive learning and CLIP.

Part VIII·3 chapters · 12 sections

ReinforcementDQN, PPO, and RL in practice.

Part IX·4 chapters · 15 sections

ProductionScaling, compression, and deployment.

Advanced Optimization

Cutting-edge optimization techniques

4 sections72 min read
Start chapter
  1. 01Advanced Optimizers22m
  2. 02Learning Rate Schedules18m
  3. 03Gradient Accumulation12m
  4. 04Mixed Precision Training20m

Scaling Deep Learning

Training at scale

3 sections61 min read
Start chapter
  1. 01Multi-GPU Training25m
  2. 02Model Parallelism18m
  3. 03Efficient Training18m

Model Compression

Making models smaller and faster

4 sections82 min read
Start chapter
  1. 01Knowledge Distillation22m
  2. 02Pruning20m
  3. 03Quantization22m
  4. 04Efficient Architectures18m
Part X·3 chapters · 12 sections

ProjectsYOLO, NMT, and time series.

Project - Object Detection with YOLO

Real-time object detection

4 sections86 min read
Start chapter
  1. 01Object Detection Overview18m
  2. 02YOLO Architecture25m
  3. 03Implementation and Training25m
  4. 04Real-time Inference18m

Project - Neural Machine Translation

Building a translation system

4 sections81 min read
Start chapter
  1. 01NMT Overview18m
  2. 02Transformer for Translation25m
  3. 03Training Pipeline20m
  4. 04Evaluation and Analysis18m
Part XI·1 chapter · 4 sections

Best PracticesProfessional deep learning workflows.

Deep Learning Best Practices

Wisdom from practitioners

4 sections67 min read
Start chapter
  1. 01Experiment Management20m
  2. 02Code Organization15m
  3. 03Debugging Checklist20m
  4. 04Keeping Up with Research12m
The capstone

Where the book lands in practice.

Chapter 13·4 sections

Project - Image Classification System

End-to-end image classification

Open chapter
Chapter 17·4 sections

Project - Sentiment Analysis

Text classification with deep learning

Open chapter
Chapter 33·4 sections

Project - Object Detection with YOLO

Real-time object detection

Open chapter
Chapter 34·4 sections

Project - Neural Machine Translation

Building a translation system

Open chapter
Chapter 35·4 sections

Project - Time Series Forecasting

Predicting the future

Open chapter

179 sections. Begin with one.

Chapter 0 — Development Environment — is where every reader starts.