Learn PyTorch fundamentals by running interactive Jupyter notebooks covering tensors, neural networks, and data loading.
Build a ResNet image classifier in under 50 lines of code using the provided tutorial project.
Train a generative adversarial network to produce anime-style portrait images using the book's GAN project.
Implement a Chinese poem generator or object detection model using the Transformer and CenterNet project code.
Tested with PyTorch 1.6, 1.8, newer versions may require code modifications before running.
This repository contains the companion code for a Chinese-language book titled "Deep Learning Framework PyTorch: Introduction and Practice" (second edition). The code can also be used as a standalone PyTorch tutorial independent of the printed book. The repository includes over 90% of the code from the book and more than 60% of its written explanations, so it is usable without purchasing the physical copy. The material is divided into three sections. The first covers the basics of PyTorch: installation, tensors (the core data structure), automatic differentiation, building neural network layers, and working with data loading and pretrained models. This section uses Jupyter Notebooks so readers can run and modify code interactively. One exercise in this section builds a ResNet image classification network in fewer than 50 lines of code. The second section covers more advanced topics including vectorized operations, distributed and parallel training across multiple machines, and writing custom CUDA extensions for GPU operations. The third section contains a set of hands-on projects: a binary image classifier built around a Kaggle competition dataset, a generative adversarial network that produces anime-style portrait images, a Chinese poem generator using a Transformer architecture, a neural style transfer network that applies the visual style of paintings to photos, and an object detection implementation using the CenterNet algorithm. All code was written for Python 3 and tested with PyTorch versions 1.6 to 1.8. Newer PyTorch versions may or may not work without modification. The README is written in Chinese, though the code itself uses standard Python and PyTorch conventions. Issues and pull requests are welcome for bugs or unclear explanations.
← chenyuntc on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.