forked from d2l-ai/d2l-ko
-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit 35d7098
Showing
471 changed files
with
81,851 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,19 @@ | ||
**/.ipynb_checkpoints | ||
**/__pycache__ | ||
data/ | ||
*.json | ||
*.params | ||
*.DS_Store | ||
*.csv | ||
build/README.md | ||
build/environment.yml | ||
/chapter_gluon-basics/x | ||
/chapter_gluon-basics/xy | ||
/chapter_gluon-basics/mydict | ||
*egg-info* | ||
dist* | ||
build/chapter* | ||
build/_build | ||
build/img | ||
build/data | ||
build/d2l |
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,6 @@ | ||
[submodule "build/mx-theme"] | ||
path = build/mx-theme | ||
url = https://github.com/mli/mx-theme | ||
[submodule "build/utils"] | ||
path = build/utils | ||
url = https://github.com/d2l-ai/utils |
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,21 @@ | ||
stage("Build and Publish") { | ||
node { | ||
ws('workspace/d2l-en') { | ||
checkout scm | ||
sh "git submodule update --init" | ||
sh "build/utils/sanity_check.sh" | ||
sh "build/utils/clean_build.sh" | ||
sh "conda env update -f build/env.yml" | ||
sh "build/utils/build_html.sh en" | ||
sh "build/utils/build_pdf.sh en" | ||
sh "build/utils/build_pkg.sh en" | ||
if (env.BRANCH_NAME == 'master') { | ||
sh "build/utils/publish_website.sh en" | ||
withCredentials([usernamePassword(credentialsId: '13cb1009-3cda-49ef-9aaa-8a705fdaaeb7', | ||
passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { | ||
sh "build/publish_notebook.sh" | ||
} | ||
} | ||
} | ||
} | ||
} |
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,81 @@ | ||
all: html | ||
|
||
build/%.ipynb: %.md build/env.yml $(wildcard d2l/*) | ||
mkdir -p $(@D) | ||
cd $(@D); python ../utils/md2ipynb.py ../../$< ../../$@ | ||
|
||
build/%.md: %.md | ||
@mkdir -p $(@D) | ||
@cp $< $@ | ||
|
||
MARKDOWN = $(wildcard */index.md) | ||
NOTEBOOK = $(filter-out $(MARKDOWN), $(wildcard chapter*/*.md)) | ||
|
||
OBJ = $(patsubst %.md, build/%.md, $(MARKDOWN)) \ | ||
$(patsubst %.md, build/%.ipynb, $(NOTEBOOK)) | ||
|
||
FRONTPAGE_DIR = img/frontpage | ||
FRONTPAGE = $(wildcard $(FRONTPAGE_DIR)/*) | ||
FRONTPAGE_DEP = $(patsubst %, build/%, $(FRONTPAGE)) | ||
|
||
IMG_NOTEBOOK = $(filter-out $(FRONTPAGE_DIR), $(wildcard img/*)) | ||
ORIGIN_DEPS = $(IMG_NOTEBOOK) $(wildcard data/* d2l/*) environment.yml README.md | ||
DEPS = $(patsubst %, build/%, $(ORIGIN_DEPS)) | ||
|
||
PKG = build/_build/html/d2l-en.zip | ||
|
||
pkg: $(PKG) | ||
|
||
build/_build/html/d2l-en.zip: $(OBJ) $(DEPS) | ||
cd build; zip -r $(patsubst build/%, %, $@ $(DEPS)) chapter*/*md chapter*/*ipynb | ||
|
||
# Copy XX to build/XX if build/XX is depended (e.g., $(DEPS)) | ||
build/%: % | ||
@mkdir -p $(@D) | ||
@cp -r $< $@ | ||
|
||
html: $(DEPS) $(FRONTPAGE_DEP) $(OBJ) | ||
make -C build html | ||
python build/utils/post_html.py | ||
# Enable horitontal scrollbar for wide code blocks | ||
sed -i s/white-space\:pre-wrap\;//g build/_build/html/_static/sphinx_materialdesign_theme.css | ||
cp -r img/frontpage/ build/_build/html/_images/ | ||
|
||
TEX=build/_build/latex/d2l-en.tex | ||
|
||
#build/_build/latex/%.pdf: img/%.svg | ||
# @mkdir -p $(@D) | ||
# rsvg-convert -f pdf -z 0.80 -o $@ $< | ||
|
||
#SVG=$(wildcard img/*.svg) | ||
|
||
#PDFIMG = $(patsubst img/%.svg, build/_build/latex/%.pdf, $(SVG)) | ||
|
||
pdf: $(DEPS) $(OBJ) | ||
make -C build latex | ||
sed -i s/\\.svg/.pdf/g ${TEX} | ||
sed -i s/\}\\.gif/\_00\}.pdf/g $(TEX) | ||
sed -i s/{tocdepth}{0}/{tocdepth}{1}/g $(TEX) | ||
sed -i s/{\\\\releasename}{Release}/{\\\\releasename}{}/g $(TEX) | ||
sed -i s/{OriginalVerbatim}\\\[commandchars=\\\\\\\\\\\\{\\\\}\\\]/{OriginalVerbatim}\\\[commandchars=\\\\\\\\\\\\{\\\\},formatcom=\\\\footnotesize\\\]/g $(TEX) | ||
sed -i s/\\\\usepackage{geometry}/\\\\usepackage[paperwidth=187mm,paperheight=235mm,left=20mm,right=20mm,top=20mm,bottom=15mm,includefoot]{geometry}/g $(TEX) | ||
sed -i s/\\\\maketitle/\\\\maketitle\ \\\\pagebreak\\\\hspace{0pt}\\\\vfill\\\\begin{center}This\ draft\ is\ a\ testing\ version\ \(draft\ date:\ \\\\today\).\\\\\\\\\ Visit\ \\\\url{https:\\/\\/d2l.ai}\ to\ obtain\ a\ later\ or\ release\ version.\\\\end{center}\\\\vfill\\\\hspace{0pt}\\\\pagebreak/g $(TEX) | ||
sed -i s/’/\\\'/g ${TEX} | ||
# Replace nbsp to space in latex | ||
sed -i s/ /\ /g ${TEX} | ||
# Allow figure captions to include space and autowrap | ||
sed -i s/Ⓐ/\ /g ${TEX} | ||
# Remove un-translated long table descriptions | ||
sed -i /\\\\multicolumn{2}{c}\%/d $(TEX) | ||
sed -i /\\\\sphinxtablecontinued{Continued\ on\ next\ page}/d $(TEX) | ||
sed -i /{\\\\tablename\\\\\ \\\\thetable{}\ --\ continued\ from\ previous\ page}/d $(TEX) | ||
|
||
python build/utils/post_latex.py en | ||
|
||
cd build/_build/latex && \ | ||
bash ../../utils/convert_output_svg.sh && \ | ||
buf_size=10000000 xelatex d2l-en.tex && \ | ||
buf_size=10000000 xelatex d2l-en.tex | ||
|
||
clean: | ||
rm -rf build/chapter* build/_build build/img build/data build/environment.yml build/README.md $(PKG) |
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,17 @@ | ||
# Dive into Deep Learning (D2L Book) | ||
|
||
[![Build Status](http://ci.diveintodeeplearning.org/job/en/job/master/badge/icon)](http://ci.diveintodeeplearning.org/job/en/job/master/) | ||
|
||
[Book website](http://en.diveintodeeplearning.org/) | [STAT 157 Course at UC Berkeley, Spring 2019](http://courses.d2l.ai/berkeley-stat-157/index.html) | ||
|
||
|
||
## Contribute ([learn how](http://en.diveintodeeplearning.org/chapter_appendix/how-to-contribute.html)) | ||
|
||
This open source book has benefited from pedagogical suggestions, typo corrections, and other improvements from community contributors. Your help is valuable for making the book better for everyone. We will [acknowledge](https://www.d2l.ai/chapter_preface/preface.html#Acknowledgments) each contributor in the book and send a free book (hard copy) to each contributor when it is published. | ||
|
||
Dear contributors, please email your GitHub ID, name, and mailing address to d2lbook.en@gmail.com. Thanks. | ||
|
||
|
||
[Chinese version](https://github.com/d2l-ai/d2l-zh) | [Discuss and report issues](https://discuss.mxnet.io/) | ||
|
||
|
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,150 @@ | ||
# STYLE GUIDE | ||
|
||
## In General | ||
|
||
* Be clear, engaging, pragmatic, and consistent | ||
|
||
## Text | ||
|
||
* Chapters and Sections | ||
* Provide an overview at the beginning of each chapter | ||
* Be consistent in the structure of each section | ||
* Summary | ||
* Exercises | ||
* Scan the QR Code to Access Discussions | ||
* References (if any) | ||
* Quotes | ||
* Use double quotes | ||
* Symbol Descriptions | ||
* time step t(not t time step) | ||
* Tools, Class, and Functions | ||
* Gluon, MXNet, NumPy, spaCy, NDArray, Symbol, Block, HybridBlock, ResNet-18, Fashion-MNIST, matplotlib | ||
* Consider these as words without accents (``) | ||
* Sequential class/instance, HybridSequential class/instance | ||
* Without accents (``) | ||
* `backward`function | ||
* not `backward()` function | ||
* for loop | ||
* Terminologies | ||
* Consistently use | ||
* function (not method) | ||
* instance (not object) | ||
* weight, bias, label | ||
* model training, model prediction (model inference) | ||
* training/testing/validation data set | ||
* Distinguish: | ||
* hyperparameter vs parameter | ||
* mini-batch stochastic gradient descent vs stochastic gradient descent | ||
* List | ||
* https://github.com/mli/gluon-tutorials-zh/blob/master/TERMINOLOGY.md | ||
|
||
## Math | ||
|
||
* Be consistent in math format | ||
* https://github.com/goodfeli/dlbook_notation/blob/master/notation_example.pdf | ||
* Reference | ||
* the equation above/below (Equation numbering is to be consolidated by the Press) | ||
* the N equations above/below | ||
* Place punctuations within equations if necessary | ||
* e.g., comma and period | ||
* Assignment sumbol | ||
* \leftarrow | ||
|
||
## Figure | ||
|
||
* Software | ||
* Use OmniGraffle to make figures. | ||
* Export pdf (infinite canvas) in 100%, then use pdf2svg to convert to svg | ||
* `ls | while read f; do pdf2svg $f ${f%.pdf}.svg; done` | ||
* Do not export svg directly from Omnigraffle (font size may slightly change) | ||
* Style | ||
* Size: | ||
* Horizontal:<= 400 pixels (limited by page width) | ||
* Vertical:<= 200 pixels (exceptions may be made) | ||
* Thickness: | ||
* StickArrow | ||
* 1pt | ||
* arrow head size: 50% | ||
* Font: | ||
* Arial, 9pt(subscripts:7pt) | ||
* Color: | ||
* Blue as background (text is black) | ||
* Dark:66BFFF | ||
* Light:B2D9FF | ||
* Be careful about copyright | ||
* Reference | ||
* e.g., Figure 7.1 (manually) | ||
* matplotlib | ||
|
||
## Code | ||
|
||
* Each line must have <=80 characters (limited by page width) | ||
* Use utils.py to encapsulate classes/functions that are repetitively used | ||
* Give full implementation when it is used for the first time | ||
* Python | ||
* PEP8 | ||
* e.g., (https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator) | ||
* To save space, put several assignments on the same line | ||
* e.g, `num_epochs, lr = 5, 0.1` | ||
* Be consistent in variable names | ||
* `num_epochs` | ||
* number of epochs | ||
* `num_hiddens` | ||
* number of hidden units | ||
* `num_inputs` | ||
* number of inputs | ||
* `num_outputs` | ||
* number of outputs | ||
* `net` | ||
* model | ||
* `lr` | ||
* learning rate | ||
* `acc` | ||
* accuracy | ||
* During iterations | ||
* features:`X` | ||
* labels:`y`, `y_hat` or `Y`, `Y_hat` | ||
* `for X, y in data_iter` | ||
* Data sets: | ||
* features:`features` or `images` | ||
* labels:`labels` | ||
* DataLoader instance:`train_iter`, `test_iter`, `data_iter` | ||
* Comments | ||
* Add period at the end of comments. | ||
* imports | ||
* import alphabetically | ||
* `from mxnet.gluon import data as gdata, loss as gloss, nn, utils as gutils` | ||
* Print outputs | ||
* `epoch, lr, loss, train acc, time` | ||
* Around 5 lines | ||
* Print variables | ||
* if possible use `x, y` instead of `print('x:', x, 'y:', y)` at the end of the code block | ||
* String | ||
* Use single quotes | ||
* Other items | ||
* `nd.f(x)` → `x.nd` | ||
* `random_normal` → `random.normal` | ||
* multiple imports | ||
* `.1` → `1.0` | ||
* 1. → `1.0` | ||
* remove namescope | ||
|
||
## Hyperlinks | ||
|
||
* Internal hyperlinks | ||
* In the [“Linear Regression”](linear-reg.md) section | ||
* External hyperlinks | ||
* [Layer](http:bla) | ||
|
||
|
||
## QR Code | ||
|
||
* https://www.the-qrcode-generator.com/ | ||
* 75pixel, SVG | ||
|
||
|
||
## References | ||
|
||
* Append references at the end of each section | ||
* Google Scholar: APA format | ||
* All references are to be consolidated by the Press |
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,3 @@ | ||
# 404 | ||
|
||
![](img/404.jpg) |
Oops, something went wrong.