Open-source project
nndl/practice-in-paddle avatar
nndl/practice-in-paddle

practice-in-paddle: the PaddlePaddle companion code for the first edition of a deep learning book

《神经网络与深度学习:案例与实践》第一版(2022)配套代码:8 章 PaddlePaddle 实践。

1,219 stars228 forksJupyter NotebookApache-2.0

At a glance

What is it?
The practice-in-paddle repository holds the PaddlePaddle notebooks for the first, 2022 edition of Neural Networks and Deep Learning: Cases and Practice, eight chapters that each build a model from scratch and then redo it with the framework's own API. It is Apache-2.0 licensed, the last push was on 2026-09-06, and it is explicitly superseded by a PyTorch rewrite.
Who is it for?
practice-in-paddle fits a PaddlePaddle user who bought or read the 2022 first edition and wants the notebooks that match it, and it fits a Chinese-speaking reader who wants the book and the code in one place. It does not fit anyone starting from scratch in 2026, because the second edition moved to PyTorch, grew to ten chapters and added graph neural networks, large language models and agents, and the first edition's environment differs from the second.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 63 days ago.
What is it written in?
Mainly Jupyter Notebook, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 7, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • nndl/practice-in-paddle1,219 ★ · +2
Star history
Repository2026-10-202026-11-07
nndl/practice-in-paddle1.2k1.2k

2 Stars in the last 18 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The first edition is kept, and the second one is the one to use

The repository description is precise about its status. It holds the PaddlePaddle code for the first edition, published in 2022, of the book Neural Networks and Deep Learning: Cases and Practice, kept for readers of the first edition and for PaddlePaddle learners.

The very next sentence points somewhere else. The second edition switches to PyTorch, expands to ten chapters, and adds graph neural networks, large language models and agents, with the entry point being the separate nndl-practice repository.

That is an unusual thing for a project to say about itself in the first paragraph, and it is worth reading the repository with that in mind. This is a maintenance branch, not the active one. The last push was on 2026-09-06, so it is not abandoned, but nothing is being built on top of it either.

The book itself has two halves. The practice volume is the companion to a theory book, referred to as the dandelion book, and the series main site is at nndl.ai. The structure of each chapter is the pedagogic argument for the whole book: first implement the model and the algorithm from zero, then use the API the framework provides to complete an actual task, and understand the principles through data processing, training and evaluation.

That two-step structure is the reason the repository exists as notebooks rather than as a library. A reader is meant to see the same problem solved twice, once by hand and once with the framework, and the difference between the two is the lesson.

The target audience is stated too, and it is narrow: readers with Python basics who want to learn deep learning by working. The documentation says you can read it alongside the theory book, or pick the chapters that interest you from the table of contents.

Eight chapters that build up a curriculum, not a feature list

The chapter table is the whole course in eight rows, and the ordering is a syllabus.

Chapter one is practice basics, the groundwork. Chapter two is an overview of machine learning. Chapter three is linear models. Chapter four is feedforward neural networks. Chapter five is convolutional neural networks. Chapter six is recurrent neural networks. Chapter seven is network optimisation and regularisation. Chapter eight is the attention mechanism.

Read as a sequence, that is a specific pedagogical argument. It starts with what machine learning is before it introduces a model that learns, it does linear models before neural networks because the loss functions and the optimisation are easier to see in a form with one weight, it covers the two architectures that dominated the previous decade before the mechanism that superseded them, and it puts optimisation and regularisation between the architectures and attention, where a reader who has just trained a CNN still needs to know how to make it generalise.

The final chapter landing on attention is a good marker of the edition's date, and it is also the point where the book has to explain why the transformer changed the field.

Each chapter is a top-level directory in the repository, named in Chinese after the chapter title, and each contains the notebooks for that chapter. The top-level listing shows the eight chapter directories plus a `dataset/` directory and a `tests/` directory.

The `dataset/` directory matters more than it sounds. The documentation points to a dataset readme inside it as the entry point for the accompanying data, which tells you that the notebooks expect specific data in specific places rather than fetching it, and that a reader has to set that up before the cells will run. The `tests/` directory at the root suggests some of the code is exercised automatically rather than only in the notebooks, which is unusual for a book repository and worth a look if you want to see whether a notebook still runs.

How the code is actually run, and what you have to prepare first

There is no install step in the sense of a package you import, and the documentation is clear that the work happens in notebooks.

The clone is the whole setup:

bash
git clone https://github.com/nndl/practice-in-paddle.git
cd practice-in-paddle

Then you open the `.ipynb` file for the chapter you are working on in Jupyter Notebook and follow the environment and data preparation notes inside the notebook. The dataset readme provides the entry point to the accompanying data.

That last instruction is the important one. Each notebook carries its own environment notes, which means the dependency expectations live with the code rather than in a single requirements file, and the documentation warns you explicitly that the first edition environment differs from the second edition's, so you should prepare dependencies according to the version you are using.

The primary language of the repository is recorded as Jupyter Notebook, which is the honest label for a book companion. A notebook is not a module. It is a document that happens to contain code, and the cell order is part of the pedagogy. That has a practical consequence for a reader who wants to reuse the code rather than learn from it, since the functions are defined in cells and imported in later cells rather than in an importable file. The `tests/` directory is the place to look if you want something importable.

There is also a detail in the directory names worth naming, because it affects anyone who wants to script around the repository. The chapter directories are named in Chinese, for example `chap5卷积神经网络` and `chap8注意力机制`. Non-ASCII directory names are handled correctly by modern tools but they need quoting in a shell, they are awkward in URLs, and some CI systems and path-handling libraries have historically been careless with them. If you are automating against this repository, that is the first thing to test.

The video courses are part of the package

The repository does not present the notebooks as self-contained, and the documentation is right about that.

Two video courses and a platform are listed. There is a video course for the theory book, Neural Networks and Deep Learning, presented by 邱锡鹏 (Qiu Xipeng). There is a video course and online practical training for the practice volume, Cases and Practice, explained by PaddlePaddle research engineers. And there is Paddle AI Studio, which hosts both the courses and an online notebook platform.

The distinction between the two courses matters, and it is the same distinction the book makes. The theory course covers the concepts, the practice course covers the exercises in this repository. The second one being taught by framework engineers rather than the book's author is a signal about the intended relationship between the two volumes, and about who the code was written for.

AI Studio is worth a mention on its own, because it removes the environment problem entirely. If the PaddlePaddle version and the data preparation are handled by the platform, a reader can work through a chapter in a browser without assembling an environment at all. For a book that predates most people's comfort with Python tooling, that is a significant accessibility point, and it explains why the notebooks are the delivery format rather than a wrapper around an installed library.

The series main site at nndl.ai also hosts a reading path page, which suggests the books are offered as a sequence rather than standalone titles, with the theory and practice volumes meant to be read in order.

How to report a problem, and the detail that makes a report useful

The feedback section specifies exactly what a bug report for this repository must contain, and the list is a good example of what makes a report about a notebook actionable.

For a first edition code issue you submit to this repository's issue tracker, and you must state the chapter, the notebook, the PaddlePaddle and Python versions, the steps to reproduce and the error.

Five pieces of information, and each one addresses a specific failure to diagnose. The chapter and notebook identify the code, the two version numbers identify whether the problem is a version drift rather than a code error, the reproduction steps let someone else get to the same state, and the error is the symptom. Without the version pair, a report about a PaddlePaddle notebook from the 2022 edition is close to useless, because the reasonable first hypothesis is always that the environment moved on.

Learning discussion is routed elsewhere, to a separate discussion area for the series, which keeps the issue tracker for defects and the forums for questions. That split is worth noting if you maintain a repository of your own: separating the two reduces the noise in the tracker, and the cost is that a question that should have been an issue might end up in a forum where it is not tracked at all.

The README also links the second edition's ebook and code, the first edition's theory book materials in a legacy directory of the main repository, and the series reading path, so a reader landing here from a search has somewhere to go if the PaddlePaddle edition is not what they need.

Where this repository is the wrong starting point

The first case is a reader starting from zero today. The first edition is eight chapters ending at the attention mechanism, and the second edition is ten chapters that go further into graph neural networks, large language models and agents. If you are learning deep learning now, the second edition is a superset of the material and uses the framework most people are using. Choosing the first edition means choosing a smaller, older curriculum and a framework with a smaller ecosystem, and the only reason to do that is a specific one.

The second case is a PyTorch user. The library choice is not incidental here. The point of the practice volume is to implement a model by hand and then use the framework's API, and the two halves of that lesson only make sense if you use the framework in the second half. Reading the PaddlePaddle notebooks while working in PyTorch gives you the manual implementation and none of the framework comparison.

The third is a production project. These are teaching notebooks with teaching data, no packaging, no versioning, no release tags, and a repository with no GitHub releases at all. The Apache-2.0 licence applies, and the code is Apache-2.0 licensed, but there is no compatibility promise, no CI matrix over PaddlePaddle versions in the visible files, and no maintenance commitment beyond a last push in September 2026. Copying a model implementation out of a notebook is fine. Depending on the repository is not.

The fourth is a reader who does not read Chinese. The code, the comments and the documentation are in Chinese, and the video courses are in Chinese. The chapter titles alone are enough to make the structure of the book legible, since they name the architectures directly, but the prose that explains the from-scratch implementations is not available in English here, and the series site at nndl.ai is also Chinese.

One practical point to check before you commit time. The documentation says the first edition environment differs from the second edition's and to prepare dependencies according to the version you are using, and the notebooks carry the notes themselves. A 2022 notebook in a recent PaddlePaddle is exactly the case where that note matters, and the `tests/` directory at the repository root is the fastest way to find out whether anything still runs.

Editorial conclusion

practice-in-paddle fits a PaddlePaddle user who bought or read the 2022 first edition and wants the notebooks that match it, and it fits a Chinese-speaking reader who wants the book and the code in one place. It does not fit anyone starting from scratch in 2026, because the second edition moved to PyTorch, grew to ten chapters and added graph neural networks, large language models and agents, and the first edition's environment differs from the second. Before you work through it, pick the second edition unless your reasons are specifically about PaddlePaddle, and follow the environment and data preparation notes inside each notebook rather than assuming a current PaddlePaddle release will run them unchanged.

Frequently asked questions

What is in the practice-in-paddle repository?

It holds the PaddlePaddle companion code for the 2022 first edition of Neural Networks and Deep Learning: Cases and Practice, as eight chapter directories of Jupyter notebooks, from practice basics and an overview of machine learning through linear models, feedforward networks, convolutional networks, recurrent networks, optimisation and regularisation, and attention mechanisms.

Should I use this repository or the PyTorch version?

The second edition moved to PyTorch, expanded to ten chapters and added graph neural networks, large language models and agents, and its entry point is the nndl-practice repository. This one is kept for readers of the first edition and for PaddlePaddle learners.

How do I run the code in practice-in-paddle?

Clone the repository, then open the `.ipynb` file for your chapter in Jupyter Notebook and follow the environment and data preparation notes inside the notebook. The dataset readme in the `dataset/` directory gives the entry point to the accompanying data.

What should I include in a bug report for practice-in-paddle?

Submit it to this repository's issue tracker and state the chapter, the notebook, the PaddlePaddle and Python versions, the steps to reproduce, and the error. General questions go to the series discussion area instead.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. nndl/practice-in-paddle on GitHub
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/nndl-practice-in-paddle.svg)](https://hysenlabs.com/projects/nndl-practice-in-paddle)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/nndl-practice-in-paddle.svg)](https://hysenlabs.com/projects/nndl-practice-in-paddle)

Was this useful?