Skip to content

Commit

Permalink
Merge pull request #1232 from d2l-ai/master
Browse files Browse the repository at this point in the history
2.0.0版发布
  • Loading branch information
astonzhang committed Dec 7, 2022
2 parents e42ebff + cf03c0a commit 3edee26
Show file tree
Hide file tree
Showing 332 changed files with 14,128 additions and 2,499 deletions.
12 changes: 5 additions & 7 deletions INFO.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@ sudo apt-get install librsvg2-bin
```

```
wget https://github.com/adobe-fonts/source-han-sans/raw/release/OTF/SourceHanSansSC.zip
wget https://github.com/adobe-fonts/source-han-serif/raw/release/OTF/SourceHanSerifSC_SB-H.zip
wget https://github.com/adobe-fonts/source-han-serif/raw/release/OTF/SourceHanSerifSC_EL-M.zip
wget https://github.com/adobe-fonts/source-han-sans/releases/download/2.004R/SourceHanSansSC.zip
wget -O SourceHanSerifSC.zip https://github.com/adobe-fonts/source-han-serif/releases/download/2.001R/09_SourceHanSerifSC.zip
unzip SourceHanSansSC.zip
unzip SourceHanSerifSC_EL-M.zip
unzip SourceHanSerifSC_SB-H.zip
unzip SourceHanSansSC.zip -d SourceHanSansSC
unzip SourceHanSerifSC.zip -d SourceHanSerifSC
sudo mv SourceHanSansSC SourceHanSerifSC_EL-M SourceHanSerifSC_SB-H /usr/share/fonts/opentype/
sudo mv SourceHanSansSC SourceHanSerifSC /usr/share/fonts/opentype/
sudo fc-cache -f -v
```

Expand Down
7 changes: 7 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ stage("Build and Publish") {
./static/cache.sh store _build/eval_tensorflow/data
"""

sh label: "Execute Notebooks [Paddlepaddle]", script: """set -ex
conda activate ${ENV_NAME}
./static/cache.sh restore _build/eval_paddle/data
d2lbook build eval --tab paddle
./static/cache.sh store _build/eval_paddle/data
"""

sh label:"Build HTML", script:"""set -ex
conda activate ${ENV_NAME}
./static/build_html.sh
Expand Down
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

[第一版: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
[第二版: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)

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

Expand All @@ -24,7 +24,7 @@

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

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

## 本书的第二版
## 本书的英文版

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

目前,英文版已超过160节(中文版共96节),例如增加了理论背景(如优化收敛分析)、硬件设计(如参数服务器)、全新篇章(如注意力机制、推荐系统、深度学习的数学、生成对抗网络)、应用种类(如自然语言推断)、模型种类(如Transformer、BERT)等,并优化重组了大量章节(如将自然语言处理篇章按从预训练表征、到模型设计、再到下游应用重构)。

欢迎关注本书[第二版的英文开源项目](https://github.com/d2l-ai/d2l-en)
欢迎关注本书的[英文开源项目](https://github.com/d2l-ai/d2l-en)

## 中英文教学资源

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

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

[如何贡献](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)
[如何贡献](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)
8 changes: 4 additions & 4 deletions chapter_appendix-tools-for-deep-learning/aws.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 使用Amazon EC2实例
:label:`sec_aws`

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

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

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

:不同的EC2实例类型

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

## 安装库以运行代码

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

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

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

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

如果你想要将该实例用作更多实例的模板,请右击 :numref:`fig_connect`中的例子,然后选择“Image”$\rightarrow$“Create”以创建该实例的镜像。完成后,选择“实例状态”$\rightarrow$“终止”以终止实例。下次要使用此实例时,可以按照本节中的步骤基于保存的镜像创建实例。唯一的区别是,在 :numref:`fig_ubuntu`所示的“1.选择AMI”中,你必须使用左侧的“我的AMI”选项来选择你保存的镜像。创建的实例将保留镜像硬盘上存储的信息。例如,你不必重新安装CUDA和其他运行时环境。
Expand Down
3 changes: 2 additions & 1 deletion chapter_appendix-tools-for-deep-learning/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
如果你发现笔误、无效的链接、一些你认为我们遗漏了引文的地方,
代码看起来不优雅,或者解释不清楚的地方,请回复我们以帮助读者。
在常规书籍中,两次印刷之间的间隔(即修订笔误的间隔)常常需要几年,
但这本书的改进通常需要几个小时到几天的时间
但这本书的改进通常需要几小时到几天的时间
由于版本控制和持续自动集成(CI)测试,这一切颇为高效。
为此,你需要向gihub存储库提交一个
[pull request](https://github.com/d2l-ai/d2l-en/pulls)
Expand Down Expand Up @@ -45,6 +45,7 @@
请使用`#@tab`来标记代码块的起始行。
例如`#@tab pytorch`用于一个PyTorch代码块,
`#@tab tensorflow`用于一个TensorFlow代码块,
`#@tab paddle`用于一个PaddlePaddle代码块,
或者`#@tab all`是所有实现的共享代码块。
你可以参考[d2lbook](http://book.d2l.ai/user/code_tabs.html)包了解更多信息。

Expand Down
26 changes: 16 additions & 10 deletions chapter_appendix-tools-for-deep-learning/d2l.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,48 +22,54 @@
```
:end_tab:

:begin_tab:`paddle`
```eval_rst
.. currentmodule:: d2l.paddle
```
:end_tab:

## 模型

```eval_rst
```eval_rst
.. autoclass:: Module
:members:
:members:
.. autoclass:: LinearRegressionScratch
:members:
.. autoclass:: LinearRegression
:members:
:members:
.. autoclass:: Classification
:members:
```

## 数据

```eval_rst
```eval_rst
.. autoclass:: DataModule
:members:
:members:
.. autoclass:: SyntheticRegressionData
:members:
:members:
.. autoclass:: FashionMNIST
:members:
```

## 训练

```eval_rst
```eval_rst
.. autoclass:: Trainer
:members:
:members:
.. autoclass:: SGD
:members:
```

## 公用

```eval_rst
```eval_rst
.. autofunction:: add_to_class
.. autofunction:: cpu
Expand All @@ -73,7 +79,7 @@
.. autofunction:: num_gpus
.. autoclass:: ProgressBoard
:members:
:members:
.. autoclass:: HyperParameters
:members:
Expand Down
2 changes: 1 addition & 1 deletion chapter_appendix-tools-for-deep-learning/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 附录:深度学习工具
:label:`chap_appendix_tools`

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

```toc
Expand Down
6 changes: 3 additions & 3 deletions chapter_appendix-tools-for-deep-learning/jupyter.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 使用Jupyter Notebooks
# 使用Jupyter Notebook
:label:`sec_jupyter`

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

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

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

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

### 执行时间

Expand Down
11 changes: 10 additions & 1 deletion chapter_appendix-tools-for-deep-learning/sagemaker.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 使用Amazon SageMaker
:label:`sec_sagemaker`

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

## 注册

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

:begin_tab:`mxnet`

```bash
cd SageMaker/d2l-en-sagemaker/
git reset --hard
git pull
```


:end_tab:

:begin_tab:`pytorch`

```bash
cd SageMaker/d2l-pytorch-sagemaker/
git reset --hard
git pull
```


:end_tab:

:begin_tab:`tensorflow`

```bash
cd SageMaker/d2l-tensorflow-sagemaker/
git reset --hard
git pull
```


:end_tab:

## 小结
Expand Down

0 comments on commit 3edee26

Please sign in to comment.