
pytorch-book
Chinese-language PyTorch tutorial book with Jupyter notebooks and small demo projects.
- Stars
- 12.8k
- Forks
- 3.7k
- Licence
- MIT
- Language
- Jupyter Notebook
- Last update
- 2.9 years ago
- Type
- Learning resource
No commits in over a year — check for forks or alternatives before adopting.
What it is
This repository holds the code and notebooks for a Chinese book on PyTorch, the deep learning library. It is organized as a tutorial that moves from basics like tensors and autograd to neural networks, then to advanced topics and finished projects such as image generation, poem writing, style transfer and object detection. It can be read on its own as a beginner's guide.
- Work through the notebooks to learn tensors, autograd and nn modules step by step
- Study the chapter that implements ResNet in under 50 lines of code
- Run the anime avatar GAN or the Transformer poem-writing project as a demo
- Follow the style transfer chapter to build a network that applies artistic styles to images
Great for
- Chinese-speaking beginners learning PyTorch from scratch
- Students who want runnable Jupyter notebooks to experiment with
- Readers who want to see small deep learning projects like style transfer or poem generation
- People who already know Python and want an introduction to PyTorch concepts
Not ideal for
- Readers who need English-language material, since the README and course text are in Chinese
- Anyone needing the latest PyTorch features, because the README says the code was tested on PyTorch 1.6 to 1.8 and newer versions were not tested
- Readers wanting polished prose, since the README warns that the notebook text is an early draft that may contain awkward wording
How to get it
- 1
Clone and build from source
You'll need: Python 3 · PyTorch (README tested with 1.6 to 1.8)
Clone the repository
git clone https://github.com/chenyuntc/PyTorch-book.git - 2
Run it
- Install PyTorch from the official site at pytorch.org, choosing the version you need
- Clone the repository using the git command in the README
- Open the Jupyter notebooks in the repository and run the cells in order
- For the projects, follow the chapter instructions and use the pretrained demo models the README mentions
- 3
Get the most out of it
- Edit and rerun notebook cells to test ideas, as the README suggests
- Read the mind map image in the README for an overview of how chapters fit together
- Use the chapter on CUDA and the chapter on distributed training with torch.distributed and Horovod once the basics are clear
- Open issues on the repository if an explanation is unclear, as the README invites
Downloads
Strengths
- Free and open source under the MIT license, with the full code available in the repository
- Runnable Jupyter notebooks let readers change code and rerun experiments
- Covers a wide range of topics, from basics through distributed training and CUDA extensions to practical projects
Trade-offs
- Tested only on PyTorch 1.6 to 1.8 according to the README, so newer versions may need changes
- The README says the Chinese text is a draft and may contain errors, and the content is only about 80 percent consistent with the printed book
- Last push date is December 2023 and the only release is v0.2 with no binaries
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| pytorch-book (this) | 12.8k | Learning resource | beginner | 2.9 years ago | Chinese-speaking beginners learning PyTorch from scratch |
| annotated_deep_learning_paper_implementations | 67.6k | Learning resource | intermediate | 4 days ago | Students learning how transformers, GANs, or optimizers work internally |
| AI-For-Beginners | 70.5k | Learning resource | beginner | 13 days ago | Beginners who want a structured, self-paced introduction to AI |
| Made-With-ML | 49.9k | Learning resource | intermediate | 8 months ago | Software engineers who want to learn how ML models get deployed and maintained |
| pytorch-tutorial | 32.5k | Learning resource | intermediate | 3.2 years ago | Researchers or engineers who already know Python and want to learn PyTorch |
| pytorch-deep-learning | 19.3k | Learning resource | beginner | 1 months ago | Beginners in machine learning who want to learn PyTorch in a hands-on, code-first way |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.