explaingit

d2l-ai/d2l-zh

Analysis updated 2026-06-20

77,689PythonAudience · researcherComplexity · 2/5Setup · moderate

TLDR

d2l-zh is the Chinese edition of Dive into Deep Learning, a free interactive textbook pairing deep learning theory and math with runnable Python code, used at 500+ universities worldwide.

Mindmap

mindmap
  root((d2l-zh))
    Content
      Theory and math
      Runnable code
      Discussion forum
    Topics
      Neural networks
      Attention and transformers
      Computer vision
      NLP
    Editions
      Second edition Chinese
      First edition v1
      English sibling repo
    Audience
      Chinese learners
      University students
      Educators
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Work through hands-on deep learning chapters in Chinese, running and modifying code examples alongside the mathematical explanations.

USE CASE 2

Use as a university course curriculum, the book is already taught at over 500 institutions across 70 countries.

USE CASE 3

Study the mathematical foundations of deep learning paired with working Python implementations you can experiment with directly.

What is it built with?

Python

How does it compare?

d2l-ai/d2l-zhtensorflow/modelsswisskyrepo/payloadsallthethings
Stars77,68977,66777,510
LanguagePythonPythonPython
Setup difficultymoderatemoderateeasy
Complexity2/54/51/5
Audienceresearcherresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Python, Jupyter, and the d2l package, a GPU is recommended for training chapters but not required for reading.

In plain English

d2l-zh is the Chinese-language version of "Dive into Deep Learning" (D2L.ai), an open educational project that teaches deep learning in a hands-on way. Rather than software you run as an app, the repository is the source of an interactive book that combines text explanations, mathematical background, and runnable code in one place. The README mentions that both the Chinese and English versions are used as teaching material at more than 500 universities across over 70 countries. The project sets out a small set of goals. It is meant to be free for everyone on the web, deep enough to take readers from understanding the underlying mathematics to actually implementing and improving methods, and structured around code a reader can run, modify, and inspect, so a mathematical formula on the page corresponds directly to lines of code you can experiment with. The authors emphasize keeping the material continuously updated and complementing the text with a discussion forum. The README points to a second edition at zh.D2L.ai and a first edition at zh-v1.D2L.ai, with separate installation instructions for the source code accompanying each edition. The English open-source version is in a sibling repository, and a set of teaching slides comes from a UC Berkeley course that used the book as its textbook. There is a bibliography entry citing the book, published by Cambridge University Press in 2023. Someone would use this when learning deep learning in Chinese, teaching a course, or wanting a single resource that pairs theory with code. The runnable code is in Python.

Copy-paste prompts

Prompt 1
I'm learning deep learning with d2l-zh, help me run the attention mechanism code examples and explain each step in plain language.
Prompt 2
Show me how to install the d2l-zh second edition dependencies and run the first Jupyter notebook interactively on my local machine.
Prompt 3
Walk me through modifying a d2l-zh code example to train a simple image classifier on my own dataset instead of the built-in benchmark datasets.
Prompt 4
Using the approach from d2l-zh, help me implement a transformer encoder from scratch in Python and explain what each component does.

Frequently asked questions

What is d2l-zh?

d2l-zh is the Chinese edition of Dive into Deep Learning, a free interactive textbook pairing deep learning theory and math with runnable Python code, used at 500+ universities worldwide.

What language is d2l-zh written in?

Mainly Python. The stack also includes Python.

How hard is d2l-zh to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is d2l-zh for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub d2l-ai on gitmyhub

Verify against the repo before relying on details.