MLModels

Dive into Deep Learning (D2L)

by d2l.ai (Amazon scientists)

IntermediateBookFreeSelf-paced (full textbook)

A free, interactive deep-learning textbook where every concept comes with runnable code.

Start LearningReviewed July 3, 2026

Overview

Dive into Deep Learning is a remarkable free textbook: every mathematical concept is paired with executable notebook code, and it's adopted in courses at hundreds of universities. It spans linear networks, CNNs, RNNs, attention and transformers, optimization, and modern architectures, with framework implementations you can run and modify. It's ideal if you want mathematical depth without giving up hands-on practice.

At a Glance

Topic
ML
Level
Intermediate
Format
Book
Cost
Free
Duration
Self-paced (full textbook)
Provider
d2l.ai (Amazon scientists)
Hands-on
Yes — code/exercises
Certificate
None

What You’ll Learn

  • Deep learning fundamentals with the math
  • CNNs, RNNs, attention, and transformers
  • Optimization and regularization
  • Implementations in PyTorch/TensorFlow/JAX

Highlights

  • Every concept has runnable code
  • Used in university courses worldwide
  • Free and continuously updated

Who It’s For

Best For

  • Learners who want theory plus implementation

Prerequisites

  • Python
  • Linear algebra and calculus basics

FAQ

What is Dive into Deep Learning (D2L)?

An open-source, interactive textbook covering deep learning from fundamentals to transformers, with runnable code in PyTorch, TensorFlow, and JAX.

Is Dive into Deep Learning (D2L) free?

Dive into Deep Learning (D2L) is free to access.

What level is Dive into Deep Learning (D2L) for?

Dive into Deep Learning (D2L) is aimed at a intermediate audience. Recommended background: Python, Linear algebra and calculus basics.

How long does Dive into Deep Learning (D2L) take?

Expect roughly Self-paced (full textbook). Most learners work through it at their own pace.

What will I learn from Dive into Deep Learning (D2L)?

You'll learn: Deep learning fundamentals with the math; CNNs, RNNs, attention, and transformers; Optimization and regularization; Implementations in PyTorch/TensorFlow/JAX.

Topics

deep learningtextbooktransformersPyTorch