-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c168ec5
commit 1b3e3e8
Showing
31 changed files
with
2,259 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# A demo for d2l-book. | ||
[project] | ||
|
||
# The project name, used as the filename of the package and the PDF file. For | ||
# example, if set to d2l-book, then will build d2l-book.zip and d2l-book.pdf | ||
name = d2l-book | ||
|
||
# All author names | ||
author = Mu Li | ||
|
||
release = 0.1.17 | ||
|
||
[html] | ||
|
||
# A list of links that is displayed on the navbar. A link consists of three | ||
# items: name, URL, and a fontawesome icon | ||
# (https://fontawesome.com/icons?d=gallery). Items are separated by commas. | ||
header_links = PDF, https://book.d2l.ai/d2l-book.pdf, fas fa-file-pdf, | ||
Github, https://github.com/d2l-ai/d2l-book, fab fa-github | ||
|
||
# The filename of the favicon | ||
favicon = img/favicon.png | ||
|
||
html_logo = img/d2l-book.png | ||
|
||
[pdf] | ||
|
||
latex_logo = img/d2l.png | ||
|
||
[build] | ||
|
||
# A list of wildcards to indicate the markdown files that need to be evaluated as | ||
# Jupyter notebooks. | ||
notebooks = *.md */*.md | ||
|
||
|
||
# A list of files, if anyone is modified after the last build, will re-build all | ||
# documents. | ||
dependences = config.ini | ||
|
||
# A list of files that will be copied to the build folder. | ||
resources = img/ refs.bib | ||
|
||
# Specify the tabs, separated by ",". The first one will be the default tab. | ||
tabs = python, numpy, cpython | ||
|
||
[deploy] | ||
|
||
|
||
# Tracking ID for the HTML pages | ||
google_analytics_tracking_id = UA-96378503-15 | ||
|
||
# The S3 bucket that all files will copy to | ||
s3_bucket = s3://book.d2l.ai | ||
|
||
# [colab] | ||
|
||
# # The github repo to host the notebooks for colab, such as d2l-ai/d2l-book-colab | ||
# # Also make sure that the machine's ssh key is added to github before running | ||
# # "deploy" so that it can commit into d2l-ai/d2l-book-colab | ||
# github_repo = d2l-ai/d2l-book-colab | ||
|
||
# # Colab cannot display SVG files with a relative fname or a github URL. You can | ||
# # replace it with your website URL. For example: img, http://book.d2l.ai/_images | ||
# # will "img/test.svg" to "http://book.d2l.ai/_images/test.svg" | ||
# replace_svg_url = img, http://book.d2l.ai/_images | ||
|
||
|
||
# [sagemaker] | ||
# github_repo = d2l-ai/d2l-book-sagemaker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 构建本网站 | ||
|
||
您可能会发现建立这个网站是您项目的一个很好的起点。该网站的源代码可在以下位置获得 [demo/](https://github.com/d2l-ai/d2l-book/tree/master/demo). | ||
|
||
请确保你安装了`git`(可以通过 `conda install git` 安装)、`numpy` 和 `matplotlib` (可以通过 `pip install numpy matplotlib` 安装)。以下命令将下载源代码、评估所有笔记本并生成 `ipynb` 、 `html` 和 `pdf` 格式的输出。 | ||
|
||
```sh | ||
git clone https://github.com/d2l-ai/d2l-book | ||
cd d2l-book/demo | ||
d2lbook build all | ||
``` | ||
|
||
完成后,您可以在 `_build` 文件夹中检查结果。例如,现在这个页面会在 `_build/html/index.html`,PDF版本会在 `_build/pdf/d2l-book.pdf`,所有评估的笔记本都会在 `_build/eval/` 下。 | ||
你可以单独生成以下特定的格式: | ||
|
||
```sh | ||
d2lbook build eval # 评估笔记本并以 .ipynb 格式保存 | ||
d2lbook build html # 构建 html 版本 | ||
d2lbook build pdf # 构建 pdf 版本 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Development Guide | ||
|
||
解释它是如何工作的。 | ||
|
||
|
||
```toc | ||
pipeline | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 构建管道 | ||
|
||
|
||
![](../img/build.svg) | ||
|
||
|
||
源文件是一些 markdown 文件。它们要么是纯粹的 markdown 文件,要么是以 markdown 格式保存、但已删除输出的 juypyter 笔记本。对于后者,我们可以直接使用 Jupyter 运行 `notedown` 插件来打开并编辑它们,然后在提交前运行 “Kernel -> Restart & Clear Output” 以清除输出。 | ||
|
||
然后我们的构建管道会运行以下步骤来构建结果。 | ||
|
||
1. 将 .md 文件转换为 .ipynb 文件并评估每个文件。我们使用 .md 文件作为源格式的原因是因为它很容易查看源文件的更改情况。我们每次都进行评估的原因是保证每个笔记本都是可执行的。这个评估步骤可能很耗时,我们可以 | ||
- 假设每个 notebook 可以在 10 分钟内执行,我们可以使用多个 GPU 来加速执行。 | ||
- 如果源.md文件在上次评估后没有变化,我们可以重新使用缓存的.ipynb文件,以避免再次执行。 | ||
-我们使用多个进程并行运行 notebook 。 | ||
1. 带有输出的 .ipynb 文件可以直接上传到 Github,因此用户可以克隆它以在本地或云端运行它们。我们还压缩所有文件,以便用户可以轻松下载。 | ||
1. 然后将这些 .ipynb 文件转换为格式与 Sphinx 兼容的 .rst 文件。额外的预处理步骤用于图像/表格/引文参考。 | ||
1. 使用 Sphinx 构建 .html 和 .pdf 文件 | ||
1. 在线发布所有 .html/.pdf/.zip 文件,例如发布到 AWS S3 存储桶中。 | ||
|
||
## 多种实现方案 | ||
|
||
![](../img/multi-lang.svg) |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.