Skip to content

Commit 3edee26

Browse files
authored
Merge pull request #1232 from d2l-ai/master
2.0.0版发布
2 parents e42ebff + cf03c0a commit 3edee26

File tree

332 files changed

+14128
-2499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

332 files changed

+14128
-2499
lines changed

INFO.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,13 @@ sudo apt-get install librsvg2-bin
3030
```
3131

3232
```
33-
wget https://github.com/adobe-fonts/source-han-sans/raw/release/OTF/SourceHanSansSC.zip
34-
wget https://github.com/adobe-fonts/source-han-serif/raw/release/OTF/SourceHanSerifSC_SB-H.zip
35-
wget https://github.com/adobe-fonts/source-han-serif/raw/release/OTF/SourceHanSerifSC_EL-M.zip
33+
wget https://github.com/adobe-fonts/source-han-sans/releases/download/2.004R/SourceHanSansSC.zip
34+
wget -O SourceHanSerifSC.zip https://github.com/adobe-fonts/source-han-serif/releases/download/2.001R/09_SourceHanSerifSC.zip
3635
37-
unzip SourceHanSansSC.zip
38-
unzip SourceHanSerifSC_EL-M.zip
39-
unzip SourceHanSerifSC_SB-H.zip
36+
unzip SourceHanSansSC.zip -d SourceHanSansSC
37+
unzip SourceHanSerifSC.zip -d SourceHanSerifSC
4038
41-
sudo mv SourceHanSansSC SourceHanSerifSC_EL-M SourceHanSerifSC_SB-H /usr/share/fonts/opentype/
39+
sudo mv SourceHanSansSC SourceHanSerifSC /usr/share/fonts/opentype/
4240
sudo fc-cache -f -v
4341
```
4442

Jenkinsfile

+7
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ stage("Build and Publish") {
5151
./static/cache.sh store _build/eval_tensorflow/data
5252
"""
5353

54+
sh label: "Execute Notebooks [Paddlepaddle]", script: """set -ex
55+
conda activate ${ENV_NAME}
56+
./static/cache.sh restore _build/eval_paddle/data
57+
d2lbook build eval --tab paddle
58+
./static/cache.sh store _build/eval_paddle/data
59+
"""
60+
5461
sh label:"Build HTML", script:"""set -ex
5562
conda activate ${ENV_NAME}
5663
./static/build_html.sh

README.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](http://ci.d2l.ai/job/d2l-zh/job/master/badge/icon)](http://ci.d2l.ai/job/d2l-zh/job/master/)
44

5-
[第一版:zh-v1.D2L.ai](https://zh-v1.d2l.ai/) | [第二版预览版:zh.D2L.ai](https://zh.d2l.ai) | 安装和使用书中源代码:[第一版](https://zh-v1.d2l.ai/chapter_prerequisite/install.html) [第二版](https://zh.d2l.ai/chapter_installation/index.html) | 当前版本: v2.0.0-beta1
5+
[第二版:zh.D2L.ai](https://zh.d2l.ai) | [第一版:zh-v1.D2L.ai](https://zh-v1.d2l.ai/) | 安装和使用书中源代码: [第二版](https://zh.d2l.ai/chapter_installation/index.html) [第一版](https://zh-v1.d2l.ai/chapter_prerequisite/install.html)
66

77
<h5 align="center"><i>理解深度学习的最佳方法是学以致用。</i></h5>
88

@@ -24,7 +24,7 @@
2424

2525
<h5 align="center">将本书(中英文版)用作教材或参考书的大学</h5>
2626
<p align="center">
27-
<img width="400" src="http://en.d2l.ai.s3-website-us-west-2.amazonaws.com/_images/map.png">
27+
<img width="400" src="https://d2l.ai/_images/map.png">
2828
</p>
2929

3030
如果本书对你有帮助,请Star (★) 本仓库或引用本书的英文版:
@@ -38,13 +38,11 @@
3838
}
3939
```
4040

41-
## 本书的第二版
41+
## 本书的英文版
4242

43-
虽然纸质书第一版已经出版,但深度学习领域依然在迅速发展。为了得到来自更广泛的英文开源社区的帮助,从而提升本书质量,本书的第二版正在用英文写。英文版正不断被搬回中文版中
43+
虽然纸质书已出版,但深度学习领域依然在迅速发展。为了得到来自更广泛的英文开源社区的帮助,从而提升本书质量,本书的新版将继续用英文编写,并搬回中文版
4444

45-
目前,英文版已超过160节(中文版共96节),例如增加了理论背景(如优化收敛分析)、硬件设计(如参数服务器)、全新篇章(如注意力机制、推荐系统、深度学习的数学、生成对抗网络)、应用种类(如自然语言推断)、模型种类(如Transformer、BERT)等,并优化重组了大量章节(如将自然语言处理篇章按从预训练表征、到模型设计、再到下游应用重构)。
46-
47-
欢迎关注本书[第二版的英文开源项目](https://github.com/d2l-ai/d2l-en)
45+
欢迎关注本书的[英文开源项目](https://github.com/d2l-ai/d2l-en)
4846

4947
## 中英文教学资源
5048

@@ -73,7 +71,7 @@
7371
> <b>&mdash; 余凯,地平线公司创始人 & CEO</b>
7472
7573
> <p>"强烈推荐这本书!我特别赞赏这种手脑一体的学习方式。"</p>
76-
> <b>&mdash; 漆远,蚂蚁金服副总裁、首席AI科学家</b>
74+
> <b>&mdash; 漆远,复旦大学“浩清”教授、人工智能创新与产业研究院院长</b>
7775
7876
> <p>"《动手学深度学习》是一本很容易让学习者上瘾的书。"</p>
7977
> <b>&mdash; 沈强,将门创投创始合伙人</b>
@@ -82,4 +80,4 @@
8280

8381
感谢[社区贡献者们](https://github.com/d2l-ai/d2l-zh/graphs/contributors)为每一位读者改进这本开源书。
8482

85-
[如何贡献](https://zh-v2.d2l.ai/chapter_appendix-tools-for-deep-learning/contributing.html) | [致谢](https://zh-v2.d2l.ai/chapter_preface/index.html) | [讨论或报告问题](https://discuss.d2l.ai/c/chinese-version/16) | [其他](INFO.md)
83+
[如何贡献](https://zh.d2l.ai/chapter_appendix-tools-for-deep-learning/contributing.html) | [致谢](https://zh.d2l.ai/chapter_preface/index.html) | [讨论或报告问题](https://discuss.d2l.ai/c/chinese-version/16) | [其他](INFO.md)

chapter_appendix-tools-for-deep-learning/aws.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 使用Amazon EC2实例
22
:label:`sec_aws`
33

4-
在本节中,我们将向你展示如何在原始Linux机器上安装所有库。回想一下, :numref:`sec_sagemaker`中,我们讨论了如何使用Amazon SageMaker,而在云上自己构建实例的成本更低。本演示包括三个步骤
4+
本节将展示如何在原始Linux机器上安装所有库。回想一下, :numref:`sec_sagemaker`讨论了如何使用Amazon SageMaker,而在云上自己构建实例的成本更低。本演示包括三个步骤
55

66
1. 从AWS EC2请求GPU Linux实例。
77
1. 安装CUDA(或使用预装CUDA的Amazon机器映像)。
@@ -44,7 +44,7 @@
4444
:width:`700px`
4545
:label:`fig_ubuntu`
4646

47-
EC2提供了许多不同的实例配置可供选择。对于初学者来说,这有时会让人感到困惑。 :numref:`tab_ec2`列出了不同合适的计算机。
47+
EC2提供了许多不同的实例配置可供选择。对初学者来说,这有时会让人感到困惑。 :numref:`tab_ec2`列出了不同合适的计算机。
4848

4949
:不同的EC2实例类型
5050

@@ -152,7 +152,7 @@ echo "export LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:/usr/local/cuda/lib64" >> ~/.ba
152152

153153
## 安装库以运行代码
154154

155-
要运行本书的代码,只需在EC2实例上为linux用户执行 :ref:`chap_installation`中的步骤,并使用以下提示在远程linux服务器上工作
155+
要运行本书的代码,只需在EC2实例上为linux用户执行 :ref:`chap_installation`中的步骤,并使用以下提示在远程linux服务器上工作
156156

157157
* 要在Miniconda安装页面下载bash脚本,请右击下载链接并选择“copy Link address”,然后执行`wget [copied link address]`
158158
* 运行`~/miniconda3/bin/conda init`, 你可能需要执行`source~/.bashrc`,而不是关闭并重新打开当前shell。
@@ -185,7 +185,7 @@ jupyter notebook
185185

186186
由于云服务是按使用时间计费的,你应该关闭不使用的实例。请注意,还有其他选择:
187187

188-
* “Stopping”(停止)实例意味着你可以重新启动它。这类似于关闭常规服务器的电源。但是,停止的实例仍将按保留的硬盘空间收取少量费用
188+
* “Stopping”(停止)实例意味着你可以重新启动它。这类似于关闭常规服务器的电源。但是,停止的实例仍将按保留的硬盘空间收取少量费用
189189
* “Terminating”(终止)实例将删除与其关联的所有数据。这包括磁盘,因此你不能再次启动它。只有在你知道将来不需要它的情况下才这样做。
190190

191191
如果你想要将该实例用作更多实例的模板,请右击 :numref:`fig_connect`中的例子,然后选择“Image”$\rightarrow$“Create”以创建该实例的镜像。完成后,选择“实例状态”$\rightarrow$“终止”以终止实例。下次要使用此实例时,可以按照本节中的步骤基于保存的镜像创建实例。唯一的区别是,在 :numref:`fig_ubuntu`所示的“1.选择AMI”中,你必须使用左侧的“我的AMI”选项来选择你保存的镜像。创建的实例将保留镜像硬盘上存储的信息。例如,你不必重新安装CUDA和其他运行时环境。

chapter_appendix-tools-for-deep-learning/contributing.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
如果你发现笔误、无效的链接、一些你认为我们遗漏了引文的地方,
66
代码看起来不优雅,或者解释不清楚的地方,请回复我们以帮助读者。
77
在常规书籍中,两次印刷之间的间隔(即修订笔误的间隔)常常需要几年,
8-
但这本书的改进通常需要几个小时到几天的时间
8+
但这本书的改进通常需要几小时到几天的时间
99
由于版本控制和持续自动集成(CI)测试,这一切颇为高效。
1010
为此,你需要向gihub存储库提交一个
1111
[pull request](https://github.com/d2l-ai/d2l-en/pulls)
@@ -45,6 +45,7 @@
4545
请使用`#@tab`来标记代码块的起始行。
4646
例如`#@tab pytorch`用于一个PyTorch代码块,
4747
`#@tab tensorflow`用于一个TensorFlow代码块,
48+
`#@tab paddle`用于一个PaddlePaddle代码块,
4849
或者`#@tab all`是所有实现的共享代码块。
4950
你可以参考[d2lbook](http://book.d2l.ai/user/code_tabs.html)包了解更多信息。
5051

chapter_appendix-tools-for-deep-learning/d2l.md

+16-10
Original file line numberDiff line numberDiff line change
@@ -22,48 +22,54 @@
2222
```
2323
:end_tab:
2424

25+
:begin_tab:`paddle`
26+
```eval_rst
27+
.. currentmodule:: d2l.paddle
28+
```
29+
:end_tab:
30+
2531
## 模型
2632

27-
```eval_rst
33+
```eval_rst
2834
.. autoclass:: Module
29-
:members:
35+
:members:
3036
3137
.. autoclass:: LinearRegressionScratch
3238
:members:
3339
3440
.. autoclass:: LinearRegression
35-
:members:
41+
:members:
3642
3743
.. autoclass:: Classification
3844
:members:
3945
```
4046

4147
## 数据
4248

43-
```eval_rst
49+
```eval_rst
4450
.. autoclass:: DataModule
45-
:members:
51+
:members:
4652
4753
.. autoclass:: SyntheticRegressionData
48-
:members:
54+
:members:
4955
5056
.. autoclass:: FashionMNIST
5157
:members:
5258
```
5359

5460
## 训练
5561

56-
```eval_rst
62+
```eval_rst
5763
.. autoclass:: Trainer
58-
:members:
64+
:members:
5965
6066
.. autoclass:: SGD
6167
:members:
6268
```
6369

6470
## 公用
6571

66-
```eval_rst
72+
```eval_rst
6773
.. autofunction:: add_to_class
6874
6975
.. autofunction:: cpu
@@ -73,7 +79,7 @@
7379
.. autofunction:: num_gpus
7480
7581
.. autoclass:: ProgressBoard
76-
:members:
82+
:members:
7783
7884
.. autoclass:: HyperParameters
7985
:members:

chapter_appendix-tools-for-deep-learning/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 附录:深度学习工具
22
:label:`chap_appendix_tools`
33

4-
为了充分利用《动手学深度学习》,我们将在本附录中介绍不同工具
4+
为了充分利用《动手学深度学习》,本书将在本附录中介绍不同工具
55
例如如何运行这本交互式开源书籍和为本书做贡献。
66

77
```toc

chapter_appendix-tools-for-deep-learning/jupyter.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 使用Jupyter Notebooks
1+
# 使用Jupyter Notebook
22
:label:`sec_jupyter`
33

44
本节介绍如何使用Jupyter Notebook编辑和运行本书各章中的代码。确保你已按照 :ref:`chap_installation`中的说明安装了Jupyter并下载了代码。如果你想了解更多关于Jupyter的信息,请参阅其[文档](https://jupyter.readthedocs.io/en/latest/)中的优秀教程。
@@ -60,7 +60,7 @@
6060
首先,安装notedown插件,运行Jupyter Notebook并加载插件:
6161

6262
```
63-
pip install mu-notedown # 你可能需要卸载原始notedown
63+
pip install d2l-notedown # 你可能需要卸载原始notedown
6464
jupyter notebook --NotebookApp.contents_manager_class='notedown.NotedownContentsManager'
6565
```
6666

@@ -86,7 +86,7 @@ c.NotebookApp.contents_manager_class = 'notedown.NotedownContentsManager'
8686
ssh myserver -L 8888:localhost:8888
8787
```
8888

89-
以上是远程服务器`myserver`的地址。然后我们可以使用http://localhost:8888 访问运行Jupyter Notebook的远程服务器`myserver`在下一节中,我们将详细介绍如何在AWS实例上运行Jupyter Notebook。
89+
以上是远程服务器`myserver`的地址。然后我们可以使用http://localhost:8888 访问运行Jupyter Notebook的远程服务器`myserver`下一节将详细介绍如何在AWS实例上运行Jupyter Notebook。
9090

9191
### 执行时间
9292

chapter_appendix-tools-for-deep-learning/sagemaker.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 使用Amazon SageMaker
22
:label:`sec_sagemaker`
33

4-
深度学习应用程序可能需要很多计算资源,这很容易超出你的本地计算机所能提供的范围。云计算服务允许你使用功能更强大的计算机更轻松地运行本书的GPU密集型代码。本节将介绍如何使用Amazon SageMaker运行本书的代码。
4+
深度学习程序可能需要很多计算资源,这很容易超出你的本地计算机所能提供的范围。云计算服务允许你使用功能更强大的计算机更轻松地运行本书的GPU密集型代码。本节将介绍如何使用Amazon SageMaker运行本书的代码。
55

66
## 注册
77

@@ -79,27 +79,36 @@ SageMaker提供多个具有不同计算能力和价格的[实例类型](https://
7979
你可能希望在从远程存储库提取更新之前提交本地更改。否则,只需在终端中使用以下命令放弃所有本地更改:
8080

8181
:begin_tab:`mxnet`
82+
8283
```bash
8384
cd SageMaker/d2l-en-sagemaker/
8485
git reset --hard
8586
git pull
8687
```
88+
89+
8790
:end_tab:
8891

8992
:begin_tab:`pytorch`
93+
9094
```bash
9195
cd SageMaker/d2l-pytorch-sagemaker/
9296
git reset --hard
9397
git pull
9498
```
99+
100+
95101
:end_tab:
96102

97103
:begin_tab:`tensorflow`
104+
98105
```bash
99106
cd SageMaker/d2l-tensorflow-sagemaker/
100107
git reset --hard
101108
git pull
102109
```
110+
111+
103112
:end_tab:
104113

105114
## 小结

0 commit comments

Comments
 (0)