pytorch-book README

The project's README from github.com/chenyuntc/pytorch-book. As one markdown file: README.md.

这是书籍《深度学习框架PyTorch:入门与实践(第2版)》的对应代码,但是也可以作为一个独立的PyTorch入门指南和教程。

全新升级

本书第2版基于第1版进行了全新升级,全书代码基于PyTorch 1.8版本进行编写,结合第一版广大读者的意见进行了全面更新,包含了基本使用、高级扩展以及实战应用三大模块。

内容

该书(教程/仓库)的内容如图所示: 思维导图

可以看出本教程可以分为三部分:

基本使用(第2~5章)讲解PyTorch内容,这部份介绍了PyTorch中主要的的模块,和深度学习中常用的一些工具。对于这部分内容,这里利用Jupyter Notebook作为教学工具,读者可以结合notebook修改运行,反复实验。

高级扩展(第6~8章)讲解PyTorch中的一些高级扩展,学习这部分内容可以帮助读者编写更加高效的程序。

实战应用(第9~13章)利用PyTorch实现了几个酷炫有趣的应用,对于这部分的内容,本仓库给出完整的实现代码,并提供预训练好的模型作为demo,供读者测试。

Notebook中的文字描述内容及部分Markdown内容属于本书的初稿,可能存在有描述不通顺之处,还请谅解,后续作者会逐渐校正。这部分内容与书籍保证了80%的一致性,但可能有部分语病语法问题,由于时间关系暂未完全校正,后续作者会逐渐更新。

是否需要买书

书不是必要的,这个仓库包含书中60%以上的文字内容,90%以上的代码,尤其是前几章入门内容,几乎是完全保留了书中的讲解内容。读者即使不买书也能正常使用本教程。

如果你觉得你更喜欢纸质版的阅读体验,并想留下一本印刷精美、完全彩印的书籍方便翻阅,不妨小破费一笔,支持一下作者近一年以来的工作~

代码说明

代码主要在python3+PyTorch1.6~1.8下测试得到最终结果,python2暂未测试,更新版本的PyTorch暂未测试。

如果有任何不当,或者有待改进的地方,欢迎开issue讨论,或者提交pull request。

环境配置

  1. 安装PyTorch,请从官网选择指定的版本安装即可,一键安装。更多的安装方式请参阅书中说明。

  2. 克隆仓库

    git clone https://github.com/chenyuntc/PyTorch-book.git
    

^_^

有任何bug,解释不清楚的地方或者是困惑,欢迎开issue

欢迎pull requests

Happy Coding!

pytorch-book (chenyuntc/pytorch-book)

image-classification
Searching Database…

What is this?This is the companion code repository for the Chinese book 'Deep Learning Framework PyTorch: Introduction and Practice', covering PyTorch basics and fun projects like neural talk, poem writing, anime face generation, and style transfer.
Is this a standalone tutorial or does it require the book?You do not need to buy the book: the repo contains over 60% of the book's text and over 90% of its code, especially the early introductory chapters are nearly fully covered.
How do I get started with this?Install PyTorch following the official instructions for your platform, then clone the repository and open the notebooks.
Which PyTorch version does the code target?The code was mainly tested with Python 3 and PyTorch 1.6 to 1.8; Python 2 and newer PyTorch versions are untested.
Are the notebook explanations fully polished?Some of the markdown text is an early draft of the book and about 80% consistent with it, so there may be awkward phrasing or minor errors that the author is gradually fixing.
How is the content structured?It is organized in three parts: basic PyTorch usage (Chapters 2-5: Tensor, autograd, nn, data/visualization tools), advanced topics (Chapters 6-8: vectorization, distributed training, CUDA extensions), and practical applications (Chapters 9-13: image classification, GAN anime face generation, poem writing with Transformer/CharRNN, style transfer, and CenterNet object detection).
Can I write poems or generate anime faces with this?Yes, Chapter 11 implements a Transformer/CharRNN-based model that writes classical Chinese poetry (including acrostic poems), and Chapter 10 builds a GAN from scratch that generates anime avatar faces in varying styles.
Are pretrained models provided for the demo projects?Yes, for the practical application chapters the repo provides complete implementation code along with pretrained models so readers can test the demos directly.
Is the material in Chinese or English?The notebooks and accompanying text are in Chinese, matching the Chinese-language book they are based on.
Creator
chenyuntc
Size
122 MB
Stars
12.8K
Age
9y
Commits · 90 Days