README.md 3.2 KB
Newer Older
A
Aston Zhang 已提交
1
# 动手学深度学习
M
Mu Li 已提交
2

A
Aston Zhang 已提交
3
[![Build Status](http://ci.diveintodeeplearning.org/job/zh/job/master/badge/icon)](http://ci.diveintodeeplearning.org/job/zh/job/master/)
M
Mu Li 已提交
4

A
Aston Zhang 已提交
5 6 7
## 英文版 *Dive into Deep Learning*

加州大学伯克利分校2019年春学期“深度学习”课程教材。
A
Aston Zhang 已提交
8 9 10 11 12

[https://github.com/diveintodeeplearning/d2l-en](https://github.com/diveintodeeplearning/d2l-en)


## 讨论和报告问题
M
Mu Li 已提交
13

A
Aston Zhang 已提交
14
请使用 [https://discuss.gluon.ai](https://discuss.gluon.ai) 讨论或报告问题。
A
Aston Zhang 已提交
15

A
Aston Zhang 已提交
16

A
Aston Zhang 已提交
17
## [如何贡献](https://zh.diveintodeeplearning.org/chapter_appendix/how-to-contribute.html)
M
Mu Li 已提交
18

A
Aston Zhang 已提交
19
所有notebook是用markdown格式存储,这样方便merge改动。jupyter可以通过notedown来直接使用markdown,[参考这里安装](https://zh.diveintodeeplearning.org/chapter_appendix/jupyter.html#%E7%94%A8-Jupyter-%E8%AE%B0%E4%BA%8B%E6%9C%AC%E8%AF%BB%E5%86%99-GitHub-%E6%BA%90%E6%96%87%E4%BB%B6)
M
Mu Li 已提交
20

A
Aston Zhang 已提交
21 22
可以使用 https://zh.diveintodeeplearning.org.s3-website-us-west-2.amazonaws.com/ 来访问没有加载过 CDN 的版本,对代码的改动刷新更快。

23 24
## 编译HTML版本

M
Mu Li 已提交
25
所有markdown文件需要在提交前清除output,它们会在服务器上重新执行生成结果。所以需要保证每个notebook执行不要太久,目前限制是20min。
M
Mu Li 已提交
26 27 28

在本地可以如下build html(需要GPU支持)

A
rebuilt  
Aston Zhang 已提交
29
```
M
Mu Li 已提交
30 31
conda env update -f build/env.yml
source activate d2l-zh-build
M
Mu Li 已提交
32 33 34 35 36 37 38
make html
```

生成的html会在`_build/html`

如果没有改动notebook里面源代码,所以不想执行notebook,可以使用

A
rebuilt  
Aston Zhang 已提交
39
```
M
muli 已提交
40
make html EVAL=0
M
Mu Li 已提交
41 42 43
```

但这样生成的html将不含有输出结果。
M
muli 已提交
44 45 46

## 编译PDF版本

47
编译pdf版本需要xelatex、librsvg2-bin(svg图片转pdf)和思源字体。在Ubuntu可以这样安装。
M
muli 已提交
48

A
rebuilt  
Aston Zhang 已提交
49
```
M
muli 已提交
50
sudo apt-get install texlive-full
51
sudo apt-get install librsvg2-bin
M
muli 已提交
52 53
```

A
rebuilt  
Aston Zhang 已提交
54
```
M
Mu Li 已提交
55 56
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
M
muli 已提交
57
wget https://github.com/adobe-fonts/source-han-serif/raw/release/OTF/SourceHanSerifSC_EL-M.zip
M
Mu Li 已提交
58 59

unzip SourceHanSansSC.zip
M
muli 已提交
60
unzip SourceHanSerifSC_EL-M.zip
M
Mu Li 已提交
61
unzip SourceHanSerifSC_SB-H.zip
M
Mu Li 已提交
62

M
Mu Li 已提交
63
sudo mv SourceHanSansSC SourceHanSerifSC_EL-M SourceHanSerifSC_SB-H /usr/share/fonts/opentype/
M
muli 已提交
64 65 66 67 68
sudo fc-cache -f -v
```

这时候可以通过 `fc-list :lang=zh` 来查看安装的中文字体。

M
Mu Li 已提交
69 70
同样的去下载和安装英文字体

A
Aston Zhang 已提交
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
```
wget -O source-serif-pro.zip https://www.fontsquirrel.com/fonts/download/source-serif-pro
unzip source-serif-pro -d source-serif-pro
sudo mv source-serif-pro /usr/share/fonts/opentype/

wget -O source-sans-pro.zip https://www.fontsquirrel.com/fonts/download/source-sans-pro
unzip source-sans-pro -d source-sans-pro
sudo mv source-sans-pro /usr/share/fonts/opentype/

wget -O source-code-pro.zip https://www.fontsquirrel.com/fonts/download/source-code-pro
unzip source-code-pro -d source-code-pro
sudo mv source-code-pro /usr/share/fonts/opentype/

sudo fc-cache -f -v
```
M
Mu Li 已提交
86

A
Aston Zhang 已提交
87
然后就可以编译了。
M
muli 已提交
88

A
rebuilt  
Aston Zhang 已提交
89
```
M
Mu Li 已提交
90
make pdf
M
muli 已提交
91
```
92

A
readme  
Aston Zhang 已提交
93 94
## 其他安装

A
rebuilt  
Aston Zhang 已提交
95
```
A
Aston Zhang 已提交
96
python -m spacy download en # 需已 pip install spacy
A
readme  
Aston Zhang 已提交
97 98
```

A
style  
Aston Zhang 已提交
99 100
## 样式规范

A
Aston Zhang 已提交
101 102 103 104 105
贡献请遵照本教程的[样式规范](STYLE_GUIDE.md)

## 中英文术语对照

翻译请参照[中英文术语对照](TERMINOLOGY.md)
A
style  
Aston Zhang 已提交
106