What it is
d2l-zh is the repository for the Chinese edition of “Dive into Deep Learning.” It is not just a set of neural-network articles: the D2L idea is to teach deep learning through runnable code, visualizations, exercises, and a gradual path from linear regression to modern architectures.
The d2l-ai/d2l-zh repository has been on GitHub since 2017. Its description notes that the Chinese and English editions are used in university teaching across many countries. The repository’s primary language is Python, and it uses the Apache-2.0 license.
What is inside
Inside are book sources, notebooks, examples, teaching material, and the zh.d2l.ai site. Repository topics include deep learning, machine learning, computer vision, natural language processing, notebooks, and Python. That matches the format: the reader is expected to run code, not only read formulas.
The D2L learning style
This is not copied from the book. It illustrates the usual teaching pattern: a small experiment where data, model, loss, and parameter updates are close enough to read as a lab exercise.
import torch
x = torch.randn(32, 10)
y = torch.randn(32, 1)
model = torch.nn.Linear(10, 1)
loss = torch.nn.MSELoss()(model(x), y)
loss.backward()
Who it is for
The project helps readers who study deep learning in Chinese and want to connect math with code. It is also useful for teachers: chapters, notebooks, and exercises can become the base of a course, seminar, or self-study path.
For readers outside the Chinese-language audience, d2l-zh is also a strong example of an open textbook done well: structure, runnable examples, translation, community, and a dedicated site make it more durable than a single PDF.
Strengths and tradeoffs
D2L’s strength is learning by doing. Deep learning is hard to understand from definitions alone; the book pushes the reader to run code, change parameters, and see how model behavior relates to formulas.
The tradeoff is the pace of the field. Libraries, accelerators, and model-training practices change faster than a textbook. D2L is good as a foundation, while production models, new architectures, and hardware optimizations need current library docs and papers.