From b50c81ba2e6ed58038f08594d5e6d62ce176108e Mon Sep 17 00:00:00 2001 From: Aston Zhang Date: Wed, 23 Jan 2019 22:04:53 +0000 Subject: [PATCH] qr code at the end of each sectioin --- chapter_appendix/aws.md | 2 ++ chapter_appendix/buy-gpu.md | 2 ++ chapter_appendix/d2lzh.md | 4 ++++ chapter_appendix/how-to-contribute.md | 6 ++++-- chapter_appendix/index.md | 4 ++++ chapter_appendix/jupyter.md | 2 ++ chapter_appendix/math.md | 2 ++ chapter_appendix/notation.md | 4 ++++ chapter_computational-performance/async-computation.md | 2 ++ chapter_computational-performance/auto-parallelism.md | 2 ++ chapter_computational-performance/hybridize.md | 2 ++ chapter_computational-performance/index.md | 4 ++++ chapter_computational-performance/multiple-gpus-gluon.md | 2 ++ chapter_computational-performance/multiple-gpus.md | 2 ++ chapter_computer-vision/anchor.md | 2 ++ chapter_computer-vision/bounding-box.md | 2 ++ chapter_computer-vision/fcn.md | 6 ++++-- chapter_computer-vision/fine-tuning.md | 6 ++++-- chapter_computer-vision/image-augmentation.md | 2 ++ chapter_computer-vision/index.md | 4 ++++ chapter_computer-vision/kaggle-gluon-cifar10.md | 5 +++-- chapter_computer-vision/kaggle-gluon-dog.md | 7 ++++--- chapter_computer-vision/multiscale-object-detection.md | 2 ++ chapter_computer-vision/neural-style.md | 6 ++++-- chapter_computer-vision/object-detection-dataset.md | 6 ++++-- chapter_computer-vision/rcnn.md | 6 ++++-- .../semantic-segmentation-and-dataset.md | 6 ++++-- chapter_computer-vision/ssd.md | 6 ++++-- chapter_convolutional-neural-networks/alexnet.md | 6 ++++-- chapter_convolutional-neural-networks/batch-norm.md | 6 ++++-- chapter_convolutional-neural-networks/channels.md | 2 ++ chapter_convolutional-neural-networks/conv-layer.md | 2 ++ chapter_convolutional-neural-networks/densenet.md | 6 ++++-- chapter_convolutional-neural-networks/googlenet.md | 6 ++++-- chapter_convolutional-neural-networks/index.md | 4 ++++ chapter_convolutional-neural-networks/lenet.md | 6 ++++-- chapter_convolutional-neural-networks/nin.md | 6 ++++-- .../padding-and-strides.md | 2 ++ chapter_convolutional-neural-networks/pooling.md | 2 ++ chapter_convolutional-neural-networks/resnet.md | 6 ++++-- chapter_convolutional-neural-networks/vgg.md | 6 ++++-- chapter_deep-learning-basics/backprop.md | 2 ++ chapter_deep-learning-basics/dropout.md | 6 ++++-- chapter_deep-learning-basics/fashion-mnist.md | 6 ++++-- chapter_deep-learning-basics/index.md | 4 ++++ chapter_deep-learning-basics/kaggle-house-price.md | 5 +++-- chapter_deep-learning-basics/linear-regression-gluon.md | 2 ++ chapter_deep-learning-basics/linear-regression-scratch.md | 2 ++ chapter_deep-learning-basics/linear-regression.md | 2 ++ chapter_deep-learning-basics/mlp-gluon.md | 2 ++ chapter_deep-learning-basics/mlp-scratch.md | 2 ++ chapter_deep-learning-basics/mlp.md | 2 ++ .../numerical-stability-and-init.md | 6 ++++-- chapter_deep-learning-basics/softmax-regression-gluon.md | 2 ++ chapter_deep-learning-basics/softmax-regression-scratch.md | 2 ++ chapter_deep-learning-basics/softmax-regression.md | 2 ++ chapter_deep-learning-basics/underfit-overfit.md | 2 ++ chapter_deep-learning-basics/weight-decay.md | 2 ++ chapter_deep-learning-computation/custom-layer.md | 2 ++ chapter_deep-learning-computation/deferred-init.md | 2 ++ chapter_deep-learning-computation/index.md | 4 ++++ chapter_deep-learning-computation/model-construction.md | 4 +++- chapter_deep-learning-computation/parameters.md | 2 ++ chapter_deep-learning-computation/read-write.md | 2 ++ chapter_deep-learning-computation/use-gpu.md | 6 ++++-- chapter_introduction/deep-learning-intro.md | 6 ++++-- chapter_introduction/how-to-use.md | 2 ++ chapter_introduction/index.md | 4 ++++ chapter_introduction/preface.md | 4 ++++ chapter_natural-language-processing/approx-training.md | 2 ++ chapter_natural-language-processing/attention.md | 6 ++++-- chapter_natural-language-processing/beam-search.md | 2 ++ chapter_natural-language-processing/fasttext.md | 6 ++++-- chapter_natural-language-processing/glove.md | 6 ++++-- chapter_natural-language-processing/index.md | 4 ++++ chapter_natural-language-processing/machine-translation.md | 6 ++++-- .../sentiment-analysis-cnn.md | 6 ++++-- .../sentiment-analysis-rnn.md | 6 ++++-- chapter_natural-language-processing/seq2seq.md | 6 ++++-- chapter_natural-language-processing/similarity-analogy.md | 6 ++++-- chapter_natural-language-processing/word2vec-gluon.md | 6 ++++-- chapter_natural-language-processing/word2vec.md | 6 ++++-- chapter_optimization/adadelta.md | 6 ++++-- chapter_optimization/adagrad.md | 6 ++++-- chapter_optimization/adam.md | 6 ++++-- chapter_optimization/gd-sgd.md | 2 ++ chapter_optimization/index.md | 4 ++++ chapter_optimization/minibatch-sgd.md | 6 ++++-- chapter_optimization/momentum.md | 2 ++ chapter_optimization/optimization-intro.md | 6 ++++-- chapter_optimization/rmsprop.md | 6 ++++-- chapter_prerequisite/autograd.md | 2 ++ chapter_prerequisite/index.md | 4 ++++ chapter_prerequisite/install.md | 2 ++ chapter_prerequisite/lookup-api.md | 2 ++ chapter_prerequisite/ndarray.md | 2 ++ chapter_recurrent-neural-networks/bi-rnn.md | 2 ++ chapter_recurrent-neural-networks/bptt.md | 2 ++ chapter_recurrent-neural-networks/deep-rnn.md | 2 ++ chapter_recurrent-neural-networks/gru.md | 6 ++++-- chapter_recurrent-neural-networks/index.md | 4 ++++ chapter_recurrent-neural-networks/lang-model-dataset.md | 2 ++ chapter_recurrent-neural-networks/lang-model.md | 2 ++ chapter_recurrent-neural-networks/lstm.md | 6 ++++-- chapter_recurrent-neural-networks/rnn-gluon.md | 2 ++ chapter_recurrent-neural-networks/rnn-scratch.md | 2 ++ chapter_recurrent-neural-networks/rnn.md | 2 ++ 107 files changed, 325 insertions(+), 86 deletions(-) diff --git a/chapter_appendix/aws.md b/chapter_appendix/aws.md index 454f7a4..7aaa9c6 100644 --- a/chapter_appendix/aws.md +++ b/chapter_appendix/aws.md @@ -188,6 +188,8 @@ ssh -i "/path/to/key.pem" ubuntu@ec2-xx-xxx-xxx-xxx.y.compute.amazonaws.com -L 8 * 云很方便,但不便宜。研究一下它的价格,看看如何节省开销。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6154) ![](../img/qr_aws.svg) diff --git a/chapter_appendix/buy-gpu.md b/chapter_appendix/buy-gpu.md index 10e7d6b..fe318a7 100644 --- a/chapter_appendix/buy-gpu.md +++ b/chapter_appendix/buy-gpu.md @@ -50,6 +50,8 @@ GPU的性能主要由以下3个参数构成。 * 浏览本节讨论区中大家有关机器配置方面的交流。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1177) ![](../img/qr_buy-gpu.svg) diff --git a/chapter_appendix/d2lzh.md b/chapter_appendix/d2lzh.md index dc589b9..377b395 100644 --- a/chapter_appendix/d2lzh.md +++ b/chapter_appendix/d2lzh.md @@ -58,3 +58,7 @@ * `voc_label_indices`:[语义分割和数据集](../chapter_computer-vision/semantic-segmentation-and-dataset.md) * `voc_rand_crop`:[语义分割和数据集](../chapter_computer-vision/semantic-segmentation-and-dataset.md) * `VOCSegDataset`:[语义分割和数据集](../chapter_computer-vision/semantic-segmentation-and-dataset.md) + + + + diff --git a/chapter_appendix/how-to-contribute.md b/chapter_appendix/how-to-contribute.md index 0406c45..b0d4659 100644 --- a/chapter_appendix/how-to-contribute.md +++ b/chapter_appendix/how-to-contribute.md @@ -75,9 +75,7 @@ git push * 如果觉得本书某些地方可以改进,尝试提交一个pull request。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7570) -![](../img/qr_how-to-contribute.svg) ## 参考文献 @@ -89,3 +87,7 @@ git push [3] 安装Git。https://git-scm.com/book/zh/v2 [4] GitHub网址。https://github.com/ + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7570) + +![](../img/qr_how-to-contribute.svg) diff --git a/chapter_appendix/index.md b/chapter_appendix/index.md index 8dad87c..dbd308b 100644 --- a/chapter_appendix/index.md +++ b/chapter_appendix/index.md @@ -13,3 +13,7 @@ how-to-contribute d2lzh ``` + + + + diff --git a/chapter_appendix/jupyter.md b/chapter_appendix/jupyter.md index 8864970..a74730d 100644 --- a/chapter_appendix/jupyter.md +++ b/chapter_appendix/jupyter.md @@ -113,6 +113,8 @@ jupyter nbextension enable execute_time/ExecuteTime * 尝试在本地编辑和运行本书的代码。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6965) ![](../img/qr_jupyter.svg) diff --git a/chapter_appendix/math.md b/chapter_appendix/math.md index 767f0b8..c2e3c8e 100644 --- a/chapter_appendix/math.md +++ b/chapter_appendix/math.md @@ -335,6 +335,8 @@ $$E(X) = \sum_{x} x P(X = x).$$ * 求函数$f(\boldsymbol{x}) = 3x_1^2 + 5e^{x_2}$的梯度。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6966) ![](../img/qr_math.svg) diff --git a/chapter_appendix/notation.md b/chapter_appendix/notation.md index 6dcb6fa..4c8f391 100644 --- a/chapter_appendix/notation.md +++ b/chapter_appendix/notation.md @@ -53,3 +53,7 @@ ## 复杂度 * $\mathcal{O}$:大O符号(渐进符号) + + + + diff --git a/chapter_computational-performance/async-computation.md b/chapter_computational-performance/async-computation.md index a2994c6..2736b9a 100644 --- a/chapter_computational-performance/async-computation.md +++ b/chapter_computational-performance/async-computation.md @@ -204,6 +204,8 @@ print('increased memory: %f MB' % (get_mem() - mem)) * 在“使用异步计算提升计算性能”一节中,我们提到使用异步计算可以使执行1000次计算的总耗时降为$t_1 + 1000 t_2 + t_3$。这里为什么要假设$1000t_2 > 999t_1$? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1881) ![](../img/qr_async-computation.svg) diff --git a/chapter_computational-performance/auto-parallelism.md b/chapter_computational-performance/auto-parallelism.md index 9ebca52..e7d9bef 100644 --- a/chapter_computational-performance/auto-parallelism.md +++ b/chapter_computational-performance/auto-parallelism.md @@ -96,6 +96,8 @@ with d2l.Benchmark('Run and copy in parallel.'): * 当运算符的计算量足够小时,仅在CPU或单块GPU上并行计算也可能提升计算性能。设计实验来验证这一点。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1883) ![](../img/qr_auto-parallelism.svg) diff --git a/chapter_computational-performance/hybridize.md b/chapter_computational-performance/hybridize.md index 185cf40..42bcc44 100644 --- a/chapter_computational-performance/hybridize.md +++ b/chapter_computational-performance/hybridize.md @@ -210,6 +210,8 @@ net(x) * 回顾前面几章中你感兴趣的模型,改用`HybridBlock`类或`HybridSequential`类实现。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1665) ![](../img/qr_hybridize.svg) diff --git a/chapter_computational-performance/index.md b/chapter_computational-performance/index.md index 2b2efde..a4e6af7 100644 --- a/chapter_computational-performance/index.md +++ b/chapter_computational-performance/index.md @@ -13,3 +13,7 @@ multiple-gpus multiple-gpus-gluon ``` + + + + diff --git a/chapter_computational-performance/multiple-gpus-gluon.md b/chapter_computational-performance/multiple-gpus-gluon.md index e7dea14..15be2ba 100644 --- a/chapter_computational-performance/multiple-gpus-gluon.md +++ b/chapter_computational-performance/multiple-gpus-gluon.md @@ -121,6 +121,8 @@ train(num_gpus=2, batch_size=512, lr=0.2) * 本节使用了ResNet-18模型。试试不同的迭代周期、批量大小和学习率。如果条件允许,使用更多GPU来计算。 * 有时候,不同设备的计算能力不一样,例如,同时使用CPU和GPU,或者不同GPU之间型号不一样。这时候,应该如何将小批量划分到内存或不同显卡的显存? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1885) ![](../img/qr_multiple-gpus-gluon.svg) diff --git a/chapter_computational-performance/multiple-gpus.md b/chapter_computational-performance/multiple-gpus.md index 32e1445..7f21efa 100644 --- a/chapter_computational-performance/multiple-gpus.md +++ b/chapter_computational-performance/multiple-gpus.md @@ -198,6 +198,8 @@ train(num_gpus=2, batch_size=256, lr=0.2) * 将实验的模型预测部分改为用多GPU预测。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1884) ![](../img/qr_multiple-gpus.svg) diff --git a/chapter_computer-vision/anchor.md b/chapter_computer-vision/anchor.md index 102e48d..0238287 100644 --- a/chapter_computer-vision/anchor.md +++ b/chapter_computer-vision/anchor.md @@ -230,6 +230,8 @@ for i in output[0].asnumpy(): * 修改“标注训练集的锚框”与“输出预测边界框”两小节中的变量`anchors`,结果有什么变化? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7024) ![](../img/qr_anchor.svg) diff --git a/chapter_computer-vision/bounding-box.md b/chapter_computer-vision/bounding-box.md index 4090279..e4d8ef0 100644 --- a/chapter_computer-vision/bounding-box.md +++ b/chapter_computer-vision/bounding-box.md @@ -57,6 +57,8 @@ fig.axes.add_patch(bbox_to_rect(cat_bbox, 'red')); * 找一些图像,尝试标注其中目标的边界框。比较标注边界框与标注类别所花时间的差异。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7023) ![](../img/qr_bounding-box.svg) diff --git a/chapter_computer-vision/fcn.md b/chapter_computer-vision/fcn.md index 046e70e..b9e00f5 100644 --- a/chapter_computer-vision/fcn.md +++ b/chapter_computer-vision/fcn.md @@ -234,9 +234,7 @@ d2l.show_images(imgs[::3] + imgs[1::3] + imgs[2::3], 3, n); * 预测测试图像中所有像素的类别。 * 全卷积网络的论文中还使用了卷积神经网络的某些中间层的输出 [1]。试着实现这个想法。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/3041) -![](../img/qr_fcn.svg) ## 参考文献 @@ -244,3 +242,7 @@ d2l.show_images(imgs[::3] + imgs[1::3] + imgs[2::3], 3, n); [1] Long, J., Shelhamer, E., & Darrell, T. (2015). Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 3431-3440). [2] Dumoulin, V., & Visin, F. (2016). A guide to convolution arithmetic for deep learning. arXiv preprint arXiv:1603.07285. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/3041) + +![](../img/qr_fcn.svg) diff --git a/chapter_computer-vision/fine-tuning.md b/chapter_computer-vision/fine-tuning.md index 2eb2e5b..dbd4f1a 100644 --- a/chapter_computer-vision/fine-tuning.md +++ b/chapter_computer-vision/fine-tuning.md @@ -175,10 +175,12 @@ hotdog_w = nd.split(weight.data(), 1000, axis=0)[713] hotdog_w.shape ``` -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/2272) -![](../img/qr_fine-tuning.svg) ## 参考文献 [1] GluonCV工具包。https://gluon-cv.mxnet.io/ + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/2272) + +![](../img/qr_fine-tuning.svg) diff --git a/chapter_computer-vision/image-augmentation.md b/chapter_computer-vision/image-augmentation.md index 64f50e3..4f528ae 100644 --- a/chapter_computer-vision/image-augmentation.md +++ b/chapter_computer-vision/image-augmentation.md @@ -245,6 +245,8 @@ train_with_data_aug(flip_aug, no_aug) * 在基于CIFAR-10数据集的模型训练中增加不同的图像增广方法。观察实现结果。 * 查阅MXNet文档,Gluon的`transforms`模块还提供了哪些图像增广方法? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1666) ![](../img/qr_image-augmentation.svg) diff --git a/chapter_computer-vision/index.md b/chapter_computer-vision/index.md index f4987ad..9d6bfc3 100644 --- a/chapter_computer-vision/index.md +++ b/chapter_computer-vision/index.md @@ -23,3 +23,7 @@ kaggle-gluon-cifar10 kaggle-gluon-dog ``` + + + + diff --git a/chapter_computer-vision/kaggle-gluon-cifar10.md b/chapter_computer-vision/kaggle-gluon-cifar10.md index ced8929..5e03cd0 100644 --- a/chapter_computer-vision/kaggle-gluon-cifar10.md +++ b/chapter_computer-vision/kaggle-gluon-cifar10.md @@ -335,8 +335,9 @@ df.to_csv('submission.csv', index=False) * 使用Kaggle比赛的完整CIFAR-10数据集。把批量大小`batch_size`和迭代周期数`num_epochs`分别改为128和300。可以在这个比赛中得到什么样的准确率和名次? * 如果不使用图像增广的方法能得到什么样的准确率? -* 扫码直达讨论区,在社区交流方法和结果。你能发掘出其他更好的技巧吗? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1545) + + +build chapter_appendix chapter_computational-performance chapter_computer-vision chapter_convolutional-neural-networks chapter_deep-learning-basics chapter_deep-learning-computation chapter_introduction chapter_natural-language-processing chapter_optimization chapter_prerequisite chapter_recurrent-neural-networks contrib d2lzh data Dockerfile environment.yml img INFO.md Jenkinsfile LICENSE Makefile post_html.sh README.md setup.py STYLE_GUIDE.md TERMINOLOGY.md 扫码直达讨论区,在社区交流方法和结果。你能发掘出其他更好的技巧吗? ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1545) ![](../img/qr_kaggle-gluon-cifar10.svg) diff --git a/chapter_computer-vision/kaggle-gluon-dog.md b/chapter_computer-vision/kaggle-gluon-dog.md index 7630700..7b66454 100644 --- a/chapter_computer-vision/kaggle-gluon-dog.md +++ b/chapter_computer-vision/kaggle-gluon-dog.md @@ -296,12 +296,13 @@ with open('submission.csv', 'w') as f: * 使用Kaggle完整数据集,把批量大小`batch_size`和迭代周期数`num_epochs`分别调大些,可以在Kaggle上拿到什么样的结果? * 使用更深的预训练模型,你能获得更好的结果吗? -* 扫码直达讨论区,在社区交流方法和结果。你能发掘出其他更好的技巧吗? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/2399) -![](../img/qr_kaggle-gluon-dog.svg) ## 参考文献 [1] Kaggle ImageNet Dogs比赛网址。https://www.kaggle.com/c/dog-breed-identification + +build chapter_appendix chapter_computational-performance chapter_computer-vision chapter_convolutional-neural-networks chapter_deep-learning-basics chapter_deep-learning-computation chapter_introduction chapter_natural-language-processing chapter_optimization chapter_prerequisite chapter_recurrent-neural-networks contrib d2lzh data Dockerfile environment.yml img INFO.md Jenkinsfile LICENSE Makefile post_html.sh README.md setup.py STYLE_GUIDE.md TERMINOLOGY.md 扫码直达讨论区,在社区交流方法和结果。你能发掘出其他更好的技巧吗? ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/2399) + +![](../img/qr_kaggle-gluon-dog.svg) diff --git a/chapter_computer-vision/multiscale-object-detection.md b/chapter_computer-vision/multiscale-object-detection.md index dbe6c76..abcc54f 100644 --- a/chapter_computer-vision/multiscale-object-detection.md +++ b/chapter_computer-vision/multiscale-object-detection.md @@ -77,6 +77,8 @@ display_anchors(fmap_w=1, fmap_h=1, s=[0.8]) * 给定一张输入图像,设特征图变量的形状为$1 \times c_i \times h \times w$,其中$c_i, h, w$分别为特征图的个数、高和宽。你能想到哪些将该变量变换为锚框的类别和偏移量的方法?输出的形状分别是什么? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/8859) ![](../img/qr_multiscale-object-detection.svg) diff --git a/chapter_computer-vision/neural-style.md b/chapter_computer-vision/neural-style.md index 174e934..d9f90df 100644 --- a/chapter_computer-vision/neural-style.md +++ b/chapter_computer-vision/neural-style.md @@ -273,10 +273,12 @@ d2l.plt.imsave('../img/neural-style-2.png', postprocess(output).asnumpy()) * 调整损失函数中的权值超参数,输出是否保留更多内容或减少更多噪点? * 替换实验中的内容图像和样式图像,你能创作出更有趣的合成图像吗? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/3273) -![](../img/qr_neural-style.svg) ## 参考文献 [1] Gatys, L. A., Ecker, A. S., & Bethge, M. (2016). Image style transfer using convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (pp. 2414-2423). + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/3273) + +![](../img/qr_neural-style.svg) diff --git a/chapter_computer-vision/object-detection-dataset.md b/chapter_computer-vision/object-detection-dataset.md index c32ac54..a285841 100644 --- a/chapter_computer-vision/object-detection-dataset.md +++ b/chapter_computer-vision/object-detection-dataset.md @@ -78,12 +78,14 @@ for ax, label in zip(axes, batch.label[0][0:10]): * 查阅MXNet文档,`image.ImageDetIter`和`image.CreateDetAugmenter`这两个类的构造函数有哪些参数?它们的意义是什么? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7022) -![](../img/qr_object-detection-dataset.svg) ## 参考文献 [1] im2rec工具。https://github.com/apache/incubator-mxnet/blob/master/tools/im2rec.py [2] GluonCV 工具包。https://gluon-cv.mxnet.io/ + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7022) + +![](../img/qr_object-detection-dataset.svg) diff --git a/chapter_computer-vision/rcnn.md b/chapter_computer-vision/rcnn.md index 4ef3315..c14f596 100644 --- a/chapter_computer-vision/rcnn.md +++ b/chapter_computer-vision/rcnn.md @@ -103,9 +103,7 @@ Fast R-CNN通常需要在选择性搜索中生成较多的提议区域,以获 * 了解GluonCV工具包中有关本节中各个模型的实现 [6]。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7219) -![](../img/qr_rcnn.svg) @@ -122,3 +120,7 @@ Fast R-CNN通常需要在选择性搜索中生成较多的提议区域,以获 [5] He, K., Gkioxari, G., Dollár, P., & Girshick, R. (2017, October). Mask r-cnn. In Computer Vision (ICCV), 2017 IEEE International Conference on (pp. 2980-2988). IEEE. [6] GluonCV 工具包。https://gluon-cv.mxnet.io/ + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7219) + +![](../img/qr_rcnn.svg) diff --git a/chapter_computer-vision/semantic-segmentation-and-dataset.md b/chapter_computer-vision/semantic-segmentation-and-dataset.md index 2739852..88928af 100644 --- a/chapter_computer-vision/semantic-segmentation-and-dataset.md +++ b/chapter_computer-vision/semantic-segmentation-and-dataset.md @@ -203,10 +203,12 @@ for X, Y in train_iter: * 回忆[“图像增广”](image-augmentation.md)一节中的内容。哪些在图像分类中使用的图像增广方法难以用于语义分割? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7218) -![](../img/qr_semantic-segmentation-and-dataset.svg) ## 参考文献 [1] Pascal VOC2012数据集。http://host.robots.ox.ac.uk/pascal/VOC/voc2012/ + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7218) + +![](../img/qr_semantic-segmentation-and-dataset.svg) diff --git a/chapter_computer-vision/ssd.md b/chapter_computer-vision/ssd.md index 9a9a1b6..2ec583c 100644 --- a/chapter_computer-vision/ssd.md +++ b/chapter_computer-vision/ssd.md @@ -367,12 +367,14 @@ d2l.plt.legend(); * 参考单发多框检测论文,还有哪些方法可以评价目标检测模型的精度 [1]? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/2511) -![](../img/qr_ssd.svg) ## 参考文献 [1] Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., Fu, C. Y., & Berg, A. C. (2016, October). Ssd: Single shot multibox detector. In European conference on computer vision (pp. 21-37). Springer, Cham. [2] Lin, T. Y., Goyal, P., Girshick, R., He, K., & Dollár, P. (2018). Focal loss for dense object detection. IEEE transactions on pattern analysis and machine intelligence. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/2511) + +![](../img/qr_ssd.svg) diff --git a/chapter_convolutional-neural-networks/alexnet.md b/chapter_convolutional-neural-networks/alexnet.md index 7f64327..4537a1d 100644 --- a/chapter_convolutional-neural-networks/alexnet.md +++ b/chapter_convolutional-neural-networks/alexnet.md @@ -143,10 +143,12 @@ d2l.train_ch5(net, train_iter, test_iter, batch_size, trainer, ctx, num_epochs) * 修改批量大小,观察准确率和内存或显存的变化。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1258) -![](../img/qr_alexnet.svg) ## 参考文献 [1] Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems (pp. 1097-1105). + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1258) + +![](../img/qr_alexnet.svg) diff --git a/chapter_convolutional-neural-networks/batch-norm.md b/chapter_convolutional-neural-networks/batch-norm.md index 4984128..b4c9cbe 100644 --- a/chapter_convolutional-neural-networks/batch-norm.md +++ b/chapter_convolutional-neural-networks/batch-norm.md @@ -203,10 +203,12 @@ d2l.train_ch5(net, train_iter, test_iter, batch_size, trainer, ctx, * 查看`BatchNorm`类的文档来了解更多使用方法,例如,如何在训练时使用基于全局平均的均值和方差。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1253) -![](../img/qr_batch-norm.svg) ## 参考文献 [1] Ioffe, S., & Szegedy, C. (2015). Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1253) + +![](../img/qr_batch-norm.svg) diff --git a/chapter_convolutional-neural-networks/channels.md b/chapter_convolutional-neural-networks/channels.md index 775c3f0..5b5aeb6 100644 --- a/chapter_convolutional-neural-networks/channels.md +++ b/chapter_convolutional-neural-networks/channels.md @@ -109,6 +109,8 @@ Y2 = corr2d_multi_in_out(X, K) * 当卷积窗口不为$1\times 1$时,如何用矩阵乘法实现卷积计算? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6405) ![](../img/qr_channels.svg) diff --git a/chapter_convolutional-neural-networks/conv-layer.md b/chapter_convolutional-neural-networks/conv-layer.md index 79e7fbc..1f55af1 100644 --- a/chapter_convolutional-neural-networks/conv-layer.md +++ b/chapter_convolutional-neural-networks/conv-layer.md @@ -152,6 +152,8 @@ conv2d.weight.data().reshape((1, 2)) * 如何通过变化输入和核数组将互相关运算表示成一个矩阵乘法? * 如何构造一个全连接层来进行物体边缘检测? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6314) ![](../img/qr_conv-layer.svg) diff --git a/chapter_convolutional-neural-networks/densenet.md b/chapter_convolutional-neural-networks/densenet.md index 6d89ec8..df82001 100644 --- a/chapter_convolutional-neural-networks/densenet.md +++ b/chapter_convolutional-neural-networks/densenet.md @@ -132,10 +132,12 @@ d2l.train_ch5(net, train_iter, test_iter, batch_size, trainer, ctx, * DenseNet被人诟病的一个问题是内存或显存消耗过多。真的会这样吗?可以把输入形状换成$224\times 224$,来看看实际的消耗。 * 实现DenseNet论文中的表1提出的不同版本的DenseNet [1]。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1664) -![](../img/qr_densenet.svg) ## 参考文献 [1] Huang, G., Liu, Z., Weinberger, K. Q., & van der Maaten, L. (2017). Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition (Vol. 1, No. 2). + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1664) + +![](../img/qr_densenet.svg) diff --git a/chapter_convolutional-neural-networks/googlenet.md b/chapter_convolutional-neural-networks/googlenet.md index 7e3e85e..04382f8 100644 --- a/chapter_convolutional-neural-networks/googlenet.md +++ b/chapter_convolutional-neural-networks/googlenet.md @@ -132,9 +132,7 @@ d2l.train_ch5(net, train_iter, test_iter, batch_size, trainer, ctx, * 对比AlexNet、VGG和NiN、GoogLeNet的模型参数尺寸。为什么后两个网络可以显著减小模型参数尺寸? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1662) -![](../img/qr_googlenet.svg) ## 参考文献 @@ -145,3 +143,7 @@ d2l.train_ch5(net, train_iter, test_iter, batch_size, trainer, ctx, [3] Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., & Wojna, Z. (2016). Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (pp. 2818-2826). [4] Szegedy, C., Ioffe, S., Vanhoucke, V., & Alemi, A. A. (2017, February). Inception-v4, inception-resnet and the impact of residual connections on learning. In Proceedings of the AAAI Conference on Artificial Intelligence (Vol. 4, p. 12). + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1662) + +![](../img/qr_googlenet.svg) diff --git a/chapter_convolutional-neural-networks/index.md b/chapter_convolutional-neural-networks/index.md index 2d28869..706b811 100644 --- a/chapter_convolutional-neural-networks/index.md +++ b/chapter_convolutional-neural-networks/index.md @@ -20,3 +20,7 @@ resnet densenet ``` + + + + diff --git a/chapter_convolutional-neural-networks/lenet.md b/chapter_convolutional-neural-networks/lenet.md index 7da4645..4a4423e 100644 --- a/chapter_convolutional-neural-networks/lenet.md +++ b/chapter_convolutional-neural-networks/lenet.md @@ -137,10 +137,12 @@ train_ch5(net, train_iter, test_iter, batch_size, trainer, ctx, num_epochs) * 尝试基于LeNet构造更复杂的网络来提高分类准确率。例如,调整卷积窗口大小、输出通道数、激活函数和全连接层输出个数。在优化方面,可以尝试使用不同的学习率、初始化方法以及增加迭代周期。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/737) -![](../img/qr_lenet.svg) ## 参考文献 [1] LeCun, Y., Bottou, L., Bengio, Y., & Haffner, P. (1998). Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11), 2278-2324. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/737) + +![](../img/qr_lenet.svg) diff --git a/chapter_convolutional-neural-networks/nin.md b/chapter_convolutional-neural-networks/nin.md index f3304a6..33efe82 100644 --- a/chapter_convolutional-neural-networks/nin.md +++ b/chapter_convolutional-neural-networks/nin.md @@ -82,10 +82,12 @@ d2l.train_ch5(net, train_iter, test_iter, batch_size, trainer, ctx, * 为什么NiN块里要有两个$1\times 1$卷积层?去除其中的一个,观察并分析实验现象。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1661) -![](../img/qr_nin.svg) ## 参考文献 [1] Lin, M., Chen, Q., & Yan, S. (2013). Network in network. arXiv preprint arXiv:1312.4400. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1661) + +![](../img/qr_nin.svg) diff --git a/chapter_convolutional-neural-networks/padding-and-strides.md b/chapter_convolutional-neural-networks/padding-and-strides.md index 653df41..cb77d38 100644 --- a/chapter_convolutional-neural-networks/padding-and-strides.md +++ b/chapter_convolutional-neural-networks/padding-and-strides.md @@ -92,6 +92,8 @@ comp_conv2d(conv2d, X).shape * 对本节最后一个例子通过形状计算公式来计算输出形状,看看是否和实验结果一致。 * 在本节实验中,试一试其他的填充和步幅组合。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6404) ![](../img/qr_padding-and-strides.svg) diff --git a/chapter_convolutional-neural-networks/pooling.md b/chapter_convolutional-neural-networks/pooling.md index c0803d6..138f2e9 100644 --- a/chapter_convolutional-neural-networks/pooling.md +++ b/chapter_convolutional-neural-networks/pooling.md @@ -115,6 +115,8 @@ pool2d(X) * 想一想,最大池化层和平均池化层在作用上可能有哪些区别? * 你觉得最小池化层这个想法有没有意义? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6406) ![](../img/qr_pooling.svg) diff --git a/chapter_convolutional-neural-networks/resnet.md b/chapter_convolutional-neural-networks/resnet.md index 8a6e9cf..529fb32 100644 --- a/chapter_convolutional-neural-networks/resnet.md +++ b/chapter_convolutional-neural-networks/resnet.md @@ -135,12 +135,14 @@ d2l.train_ch5(net, train_iter, test_iter, batch_size, trainer, ctx, * 对于比较深的网络, ResNet论文中介绍了一个“瓶颈”架构来降低模型复杂度。尝试实现它 [1]。 * 在ResNet的后续版本里,作者将残差块里的“卷积、批量归一化和激活”结构改成了“批量归一化、激活和卷积”,实现这个改进([2],图1)。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1663) -![](../img/qr_resnet.svg) ## 参考文献 [1] He, K., Zhang, X., Ren, S., & Sun, J. (2016). Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 770-778). [2] He, K., Zhang, X., Ren, S., & Sun, J. (2016, October). Identity mappings in deep residual networks. In European Conference on Computer Vision (pp. 630-645). Springer, Cham. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1663) + +![](../img/qr_resnet.svg) diff --git a/chapter_convolutional-neural-networks/vgg.md b/chapter_convolutional-neural-networks/vgg.md index b595125..38ac04d 100644 --- a/chapter_convolutional-neural-networks/vgg.md +++ b/chapter_convolutional-neural-networks/vgg.md @@ -92,10 +92,12 @@ d2l.train_ch5(net, train_iter, test_iter, batch_size, trainer, ctx, * 尝试将Fashion-MNIST中图像的高和宽由224改为96。这在实验中有哪些影响? * 参考VGG论文里的表1来构造VGG其他常用模型,如VGG-16和VGG-19 [1]。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1277) -![](../img/qr_vgg.svg) ## 参考文献 [1] Simonyan, K., & Zisserman, A. (2014). Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1277) + +![](../img/qr_vgg.svg) diff --git a/chapter_deep-learning-basics/backprop.md b/chapter_deep-learning-basics/backprop.md index 737cf5c..d78c1ee 100644 --- a/chapter_deep-learning-basics/backprop.md +++ b/chapter_deep-learning-basics/backprop.md @@ -121,6 +121,8 @@ $$ * 在本节样例模型的隐藏层和输出层中添加偏差参数,修改计算图以及正向传播和反向传播的数学表达式。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/3710) ![](../img/qr_backprop.svg) diff --git a/chapter_deep-learning-basics/dropout.md b/chapter_deep-learning-basics/dropout.md index c49246f..3721d5b 100644 --- a/chapter_deep-learning-basics/dropout.md +++ b/chapter_deep-learning-basics/dropout.md @@ -138,10 +138,12 @@ d2l.train_ch3(net, train_iter, test_iter, loss, num_epochs, batch_size, None, * 如果将模型改得更加复杂,如增加隐藏层单元,使用丢弃法应对过拟合的效果是否更加明显? * 以本节中的模型为例,比较使用丢弃法与权重衰减的效果。如果同时使用丢弃法和权重衰减,效果会如何? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1278) -![](../img/qr_dropout.svg) ## 参考文献 [1] Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I., & Salakhutdinov, R. (2014). Dropout: a simple way to prevent neural networks from overfitting. JMLR + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1278) + +![](../img/qr_dropout.svg) diff --git a/chapter_deep-learning-basics/fashion-mnist.md b/chapter_deep-learning-basics/fashion-mnist.md index e46584f..3d08234 100644 --- a/chapter_deep-learning-basics/fashion-mnist.md +++ b/chapter_deep-learning-basics/fashion-mnist.md @@ -125,9 +125,7 @@ for X, y in train_iter: * 查阅MXNet文档,`mxnet.gluon.data.vision.transforms`还提供了哪些别的变换方法? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7760) -![](../img/qr_fashion-mnist.svg) ## 参考文献 @@ -135,3 +133,7 @@ for X, y in train_iter: [1] LeCun, Y., Cortes, C., & Burges, C. http://yann.lecun.com/exdb/mnist/ [2] Xiao, H., Rasul, K., & Vollgraf, R. (2017). Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7760) + +![](../img/qr_fashion-mnist.svg) diff --git a/chapter_deep-learning-basics/index.md b/chapter_deep-learning-basics/index.md index d66276e..e7c7046 100644 --- a/chapter_deep-learning-basics/index.md +++ b/chapter_deep-learning-basics/index.md @@ -27,3 +27,7 @@ kaggle-house-price ``` + + + + diff --git a/chapter_deep-learning-basics/kaggle-house-price.md b/chapter_deep-learning-basics/kaggle-house-price.md index 5d317b8..e3b6ec2 100644 --- a/chapter_deep-learning-basics/kaggle-house-price.md +++ b/chapter_deep-learning-basics/kaggle-house-price.md @@ -244,8 +244,9 @@ train_and_pred(train_features, test_features, train_labels, test_data, * 在Kaggle提交本节的预测结果。观察一下,这个结果在Kaggle上能拿到什么样的分数? * 对照$K$折交叉验证结果,不断修改模型(例如添加隐藏层)和调参,能提高Kaggle上的分数吗? * 如果不使用本节中对连续数值特征的标准化处理,结果会有什么变化? -* 扫码直达讨论区,在社区交流方法和结果。你能发掘出其他更好的技巧吗? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1039) + + +build chapter_appendix chapter_computational-performance chapter_computer-vision chapter_convolutional-neural-networks chapter_deep-learning-basics chapter_deep-learning-computation chapter_introduction chapter_natural-language-processing chapter_optimization chapter_prerequisite chapter_recurrent-neural-networks contrib d2lzh data Dockerfile environment.yml img INFO.md Jenkinsfile LICENSE Makefile post_html.sh README.md setup.py STYLE_GUIDE.md TERMINOLOGY.md 扫码直达讨论区,在社区交流方法和结果。你能发掘出其他更好的技巧吗? ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1039) ![](../img/qr_kaggle-house-price.svg) diff --git a/chapter_deep-learning-basics/linear-regression-gluon.md b/chapter_deep-learning-basics/linear-regression-gluon.md index 1303d3e..a2527f5 100644 --- a/chapter_deep-learning-basics/linear-regression-gluon.md +++ b/chapter_deep-learning-basics/linear-regression-gluon.md @@ -132,6 +132,8 @@ true_b, dense.bias.data() * 如何访问`dense.weight`的梯度? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/742) ![](../img/qr_linear-regression-gluon.svg) diff --git a/chapter_deep-learning-basics/linear-regression-scratch.md b/chapter_deep-learning-basics/linear-regression-scratch.md index dbcfdfd..81b7e48 100644 --- a/chapter_deep-learning-basics/linear-regression-scratch.md +++ b/chapter_deep-learning-basics/linear-regression-scratch.md @@ -170,6 +170,8 @@ true_b, b * 如果样本个数不能被批量大小整除,`data_iter`函数的行为会有什么变化? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/743) ![](../img/qr_linear-regression-scratch.svg) diff --git a/chapter_deep-learning-basics/linear-regression.md b/chapter_deep-learning-basics/linear-regression.md index f9a721b..ee3f8fb 100644 --- a/chapter_deep-learning-basics/linear-regression.md +++ b/chapter_deep-learning-basics/linear-regression.md @@ -206,6 +206,8 @@ $$ * 使用其他包(如NumPy)或其他编程语言(如MATLAB),比较相加两个向量的两种方法的运行时间。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6321) ![](../img/qr_linear-regression.svg) diff --git a/chapter_deep-learning-basics/mlp-gluon.md b/chapter_deep-learning-basics/mlp-gluon.md index 64849b9..8d6ff8e 100644 --- a/chapter_deep-learning-basics/mlp-gluon.md +++ b/chapter_deep-learning-basics/mlp-gluon.md @@ -43,6 +43,8 @@ d2l.train_ch3(net, train_iter, test_iter, loss, num_epochs, batch_size, None, * 尝试多加入几个隐藏层,对比上一节中从零开始的实现。 * 使用其他的激活函数,看看对结果的影响。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/738) ![](../img/qr_mlp-gluon.svg) diff --git a/chapter_deep-learning-basics/mlp-scratch.md b/chapter_deep-learning-basics/mlp-scratch.md index 4d46cae..09ac7cb 100644 --- a/chapter_deep-learning-basics/mlp-scratch.md +++ b/chapter_deep-learning-basics/mlp-scratch.md @@ -83,6 +83,8 @@ d2l.train_ch3(net, train_iter, test_iter, loss, num_epochs, batch_size, * 改变超参数`num_hiddens`的值,看看对实验结果有什么影响。 * 试着加入一个新的隐藏层,看看对实验结果有什么影响。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/739) ![](../img/qr_mlp-scratch.svg) diff --git a/chapter_deep-learning-basics/mlp.md b/chapter_deep-learning-basics/mlp.md index 60fa0a5..3e4c4b6 100644 --- a/chapter_deep-learning-basics/mlp.md +++ b/chapter_deep-learning-basics/mlp.md @@ -151,6 +151,8 @@ $$ * 查阅资料,了解其他的激活函数。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6447) ![](../img/qr_mlp.svg) diff --git a/chapter_deep-learning-basics/numerical-stability-and-init.md b/chapter_deep-learning-basics/numerical-stability-and-init.md index 89fdd88..5b0c897 100644 --- a/chapter_deep-learning-basics/numerical-stability-and-init.md +++ b/chapter_deep-learning-basics/numerical-stability-and-init.md @@ -43,10 +43,12 @@ $$U\left(-\sqrt{\frac{6}{a+b}}, \sqrt{\frac{6}{a+b}}\right).$$ * 是否可以将线性回归或softmax回归中所有的权重参数都初始化为相同值? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/8052) -![](../img/qr_numerical-stability-and-init.svg) ## 参考文献 [1] Glorot, X., & Bengio, Y. (2010, March). Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics (pp. 249-256). + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/8052) + +![](../img/qr_numerical-stability-and-init.svg) diff --git a/chapter_deep-learning-basics/softmax-regression-gluon.md b/chapter_deep-learning-basics/softmax-regression-gluon.md index 6cb07fd..2c548d0 100644 --- a/chapter_deep-learning-basics/softmax-regression-gluon.md +++ b/chapter_deep-learning-basics/softmax-regression-gluon.md @@ -63,6 +63,8 @@ d2l.train_ch3(net, train_iter, test_iter, loss, num_epochs, batch_size, None, * 尝试调一调超参数,如批量大小、迭代周期和学习率,看看结果会怎样。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/740) ![](../img/qr_softmax-regression-gluon.svg) diff --git a/chapter_deep-learning-basics/softmax-regression-scratch.md b/chapter_deep-learning-basics/softmax-regression-scratch.md index adb72ff..95ffec1 100644 --- a/chapter_deep-learning-basics/softmax-regression-scratch.md +++ b/chapter_deep-learning-basics/softmax-regression-scratch.md @@ -183,6 +183,8 @@ d2l.show_fashion_mnist(X[0:9], titles[0:9]) * 本节中的`cross_entropy`函数是按照[“softmax回归”](softmax-regression.md)一节中的交叉熵损失函数的数学定义实现的。这样的实现方式可能有什么问题?(提示:思考一下对数函数的定义域。) * 你能想到哪些办法来解决上面的两个问题? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/741) ![](../img/qr_softmax-regression-scratch.svg) diff --git a/chapter_deep-learning-basics/softmax-regression.md b/chapter_deep-learning-basics/softmax-regression.md index ccc578b..4d1684c 100644 --- a/chapter_deep-learning-basics/softmax-regression.md +++ b/chapter_deep-learning-basics/softmax-regression.md @@ -142,6 +142,8 @@ $$\ell(\boldsymbol{\Theta}) = \frac{1}{n} \sum_{i=1}^n H\left(\boldsymbol y^{(i) * 查阅资料,了解最大似然估计。它与最小化交叉熵损失函数有哪些异曲同工之妙? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6403) ![](../img/qr_softmax-regression.svg) diff --git a/chapter_deep-learning-basics/underfit-overfit.md b/chapter_deep-learning-basics/underfit-overfit.md index b8cfa9d..2e424cc 100644 --- a/chapter_deep-learning-basics/underfit-overfit.md +++ b/chapter_deep-learning-basics/underfit-overfit.md @@ -184,6 +184,8 @@ fit_and_plot(poly_features[0:2, :], poly_features[n_train:, :], labels[0:2], * 在本节提到的三阶多项式拟合问题里,有没有可能把100个样本的训练误差的期望降到0,为什么?(提示:考虑噪声项的存在。) + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/983) ![](../img/qr_underfit-overfit.svg) diff --git a/chapter_deep-learning-basics/weight-decay.md b/chapter_deep-learning-basics/weight-decay.md index 50ebe72..230efc7 100644 --- a/chapter_deep-learning-basics/weight-decay.md +++ b/chapter_deep-learning-basics/weight-decay.md @@ -177,6 +177,8 @@ fit_and_plot_gluon(3) * 如果你了解贝叶斯统计,你觉得权重衰减对应贝叶斯统计里的哪个重要概念? * 调节实验中的权重衰减超参数,观察并分析实验结果。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/984) ![](../img/qr_weight-decay.svg) diff --git a/chapter_deep-learning-computation/custom-layer.md b/chapter_deep-learning-computation/custom-layer.md index 960d5f4..19a1180 100644 --- a/chapter_deep-learning-computation/custom-layer.md +++ b/chapter_deep-learning-computation/custom-layer.md @@ -103,6 +103,8 @@ net(nd.random.uniform(shape=(2, 64))) * 自定义一个层,使用它做一次前向计算。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1256) ![](../img/qr_custom-layer.svg) diff --git a/chapter_deep-learning-computation/deferred-init.md b/chapter_deep-learning-computation/deferred-init.md index 1d68102..c0e9a70 100644 --- a/chapter_deep-learning-computation/deferred-init.md +++ b/chapter_deep-learning-computation/deferred-init.md @@ -75,6 +75,8 @@ net.initialize(init=MyInit()) * 如果在下一次前向计算`net(X)`前改变输入`X`的形状,包括批量大小和输入个数,会发生什么? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6320) ![](../img/qr_deferred-init.svg) diff --git a/chapter_deep-learning-computation/index.md b/chapter_deep-learning-computation/index.md index a799a0b..2c65baa 100644 --- a/chapter_deep-learning-computation/index.md +++ b/chapter_deep-learning-computation/index.md @@ -15,3 +15,7 @@ use-gpu ``` + + + + diff --git a/chapter_deep-learning-computation/model-construction.md b/chapter_deep-learning-computation/model-construction.md index 2f7a8b8..b2620f74 100644 --- a/chapter_deep-learning-computation/model-construction.md +++ b/chapter_deep-learning-computation/model-construction.md @@ -146,7 +146,9 @@ net(X) * 如果将`NestMLP`类中通过`Sequential`实例定义的`self.net`改为`self.net = [nn.Dense(64, activation='relu'), nn.Dense(32, activation='relu')]`,会有什么问题? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/986) + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/986) + ![](../img/qr_model-construction.svg) diff --git a/chapter_deep-learning-computation/parameters.md b/chapter_deep-learning-computation/parameters.md index 9d50445..cc3cf92 100644 --- a/chapter_deep-learning-computation/parameters.md +++ b/chapter_deep-learning-computation/parameters.md @@ -141,6 +141,8 @@ net[1].weight.data()[0] == net[2].weight.data()[0] * 尝试在`net.initialize()`后、`net(X)`前访问模型参数,观察模型参数的形状。 * 构造一个含共享参数层的多层感知机并训练。在训练过程中,观察每一层的模型参数和梯度。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/987) ![](../img/qr_parameters.svg) diff --git a/chapter_deep-learning-computation/read-write.md b/chapter_deep-learning-computation/read-write.md index 88661e6..17e9835 100644 --- a/chapter_deep-learning-computation/read-write.md +++ b/chapter_deep-learning-computation/read-write.md @@ -90,6 +90,8 @@ Y2 == Y * 即使无须把训练好的模型部署到不同的设备,存储模型参数在实际中还有哪些好处? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1255) ![](../img/qr_read-write.svg) diff --git a/chapter_deep-learning-computation/use-gpu.md b/chapter_deep-learning-computation/use-gpu.md index 88c4e45..69b0fb4 100644 --- a/chapter_deep-learning-computation/use-gpu.md +++ b/chapter_deep-learning-computation/use-gpu.md @@ -117,11 +117,13 @@ net[0].weight.data() * 试试大一点儿的计算任务,如大矩阵的乘法,看看使用CPU和GPU的速度区别。如果是计算量很小的任务呢? * GPU上应如何读写模型参数? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/988) -![](../img/qr_use-gpu.svg) ## 参考文献 [1] CUDA下载地址。 https://developer.nvidia.com/cuda-downloads + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/988) + +![](../img/qr_use-gpu.svg) diff --git a/chapter_introduction/deep-learning-intro.md b/chapter_introduction/deep-learning-intro.md index fb2a60d..4b1577a 100644 --- a/chapter_introduction/deep-learning-intro.md +++ b/chapter_introduction/deep-learning-intro.md @@ -126,9 +126,7 @@ * 端到端的训练方法还可以用在哪里?物理学,工程学还是经济学? * 为什么应该让深度网络模仿人脑结构?为什么不该让深度网络模仿人脑结构? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/746) -![](../img/qr_deep-learning-intro.svg) ## 参考文献 @@ -175,3 +173,7 @@ [21] Lowe, D. G. (2004). Distinctive image features from scale-invariant keypoints. International journal of computer vision, 60(2), 91-110. [22] Salton, G., & McGill, M. J. (1986). Introduction to modern information retrieval. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/746) + +![](../img/qr_deep-learning-intro.svg) diff --git a/chapter_introduction/how-to-use.md b/chapter_introduction/how-to-use.md index 95a525e..c1fd75e 100644 --- a/chapter_introduction/how-to-use.md +++ b/chapter_introduction/how-to-use.md @@ -51,6 +51,8 @@ * 在本书的学习社区 https://discuss.gluon.ai/ 上注册一个账号。搜索关键字Kaggle,浏览其中回复量最大的几个帖子。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6915) ![](../img/qr_how-to-use.svg) diff --git a/chapter_introduction/index.md b/chapter_introduction/index.md index 01e1ac7..14b8553 100644 --- a/chapter_introduction/index.md +++ b/chapter_introduction/index.md @@ -14,3 +14,7 @@ how-to-use ``` + + + + diff --git a/chapter_introduction/preface.md b/chapter_introduction/preface.md index 356a92b..7aae461 100644 --- a/chapter_introduction/preface.md +++ b/chapter_introduction/preface.md @@ -74,3 +74,7 @@ 阿斯顿·张、李沐、扎卡里 C. 立顿、亚历山大 J. 斯莫拉 2018年12月 + + + + diff --git a/chapter_natural-language-processing/approx-training.md b/chapter_natural-language-processing/approx-training.md index ba716a1..b662c45 100644 --- a/chapter_natural-language-processing/approx-training.md +++ b/chapter_natural-language-processing/approx-training.md @@ -85,6 +85,8 @@ $$\sum_{w \in \mathcal{V}} P(w \mid w_c) = 1.$$ * 本节中最后一个公式为什么成立? * 如何将负采样或层序softmax用于训练连续词袋模型? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/8135) ![](../img/qr_word2vec-approx-train.svg) diff --git a/chapter_natural-language-processing/attention.md b/chapter_natural-language-processing/attention.md index cf0214e..e9359d3 100644 --- a/chapter_natural-language-processing/attention.md +++ b/chapter_natural-language-processing/attention.md @@ -93,9 +93,7 @@ $$ * 不修改[“门控循环单元(GRU)”](../chapter_recurrent-neural-networks/gru.md)一节中的`gru`函数,应如何用它实现本节介绍的解码器? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6759) -![](../img/qr_attention.svg) ## 参考文献 @@ -105,3 +103,7 @@ $$ [2] Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., ... & Polosukhin, I. (2017). Attention is all you need. In Advances in Neural Information Processing Systems (pp. 5998-6008). [3] Devlin, J., Chang, M. W., Lee, K., & Toutanova, K. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6759) + +![](../img/qr_attention.svg) diff --git a/chapter_natural-language-processing/beam-search.md b/chapter_natural-language-processing/beam-search.md index ca0c2b4..42a9b13 100644 --- a/chapter_natural-language-processing/beam-search.md +++ b/chapter_natural-language-processing/beam-search.md @@ -62,6 +62,8 @@ $$ \frac{1}{L^\alpha} \log P(y_1, \ldots, y_{L}) = \frac{1}{L^\alpha} \sum_{t'=1 * 在[“循环神经网络的从零开始实现”](../chapter_recurrent-neural-networks/rnn-scratch.md)一节中,我们使用语言模型创作歌词。它的输出属于哪种搜索?你能改进它吗? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6817) ![](../img/qr_beam-search.svg) diff --git a/chapter_natural-language-processing/fasttext.md b/chapter_natural-language-processing/fasttext.md index 1746f18..a92360a 100644 --- a/chapter_natural-language-processing/fasttext.md +++ b/chapter_natural-language-processing/fasttext.md @@ -24,9 +24,7 @@ fastText的其余部分同跳字模型一致,不在此重复。可以看到, * 子词过多(例如,6字英文组合数约为$3\times 10^8$)会有什么问题?你有什么办法来解决它吗?提示:可参考fastText论文3.2节末尾 [1]。 * 如何基于连续词袋模型设计子词嵌入模型? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/8057) -![](../img/qr_fasttext.svg) @@ -34,3 +32,7 @@ fastText的其余部分同跳字模型一致,不在此重复。可以看到, ## 参考文献 [1] Bojanowski, P., Grave, E., Joulin, A., & Mikolov, T. (2016). Enriching word vectors with subword information. arXiv preprint arXiv:1607.04606. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/8057) + +![](../img/qr_fasttext.svg) diff --git a/chapter_natural-language-processing/glove.md b/chapter_natural-language-processing/glove.md index 6a0cf7d..d96e8c1 100644 --- a/chapter_natural-language-processing/glove.md +++ b/chapter_natural-language-processing/glove.md @@ -81,10 +81,12 @@ $$\boldsymbol{u}_j^\top \boldsymbol{v}_i + b_i + c_j \approx \log(x_{ij}).$$ * 如果一个词出现在另一个词的背景窗口中,如何利用它们之间在文本序列的距离重新设计条件概率$p_{ij}$的计算方式?(提示:可参考GloVe论文4.2节 [1]。) * 对于任意词,它在GloVe模型的中心词偏差项和背景词偏差项是否等价?为什么? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4372) -![](../img/qr_glove.svg) ## 参考文献 [1] Pennington, J., Socher, R., & Manning, C. (2014). Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP) (pp. 1532-1543). + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4372) + +![](../img/qr_glove.svg) diff --git a/chapter_natural-language-processing/index.md b/chapter_natural-language-processing/index.md index 1a86c36..db13328 100644 --- a/chapter_natural-language-processing/index.md +++ b/chapter_natural-language-processing/index.md @@ -22,3 +22,7 @@ attention machine-translation ``` + + + + diff --git a/chapter_natural-language-processing/machine-translation.md b/chapter_natural-language-processing/machine-translation.md index 7d97441..9b05a8e 100644 --- a/chapter_natural-language-processing/machine-translation.md +++ b/chapter_natural-language-processing/machine-translation.md @@ -331,9 +331,7 @@ score('ils sont canadiens .', 'they are canadian .', k=2) * 试着使用更大的翻译数据集来训练模型,如WMT [2] 和Tatoeba Project [3]。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4689) -![](../img/qr_machine-translation.svg) ## 参考文献 @@ -342,3 +340,7 @@ score('ils sont canadiens .', 'they are canadian .', k=2) [2] WMT. http://www.statmt.org/wmt14/translation-task.html [3] Tatoeba Project. http://www.manythings.org/anki/ + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4689) + +![](../img/qr_machine-translation.svg) diff --git a/chapter_natural-language-processing/sentiment-analysis-cnn.md b/chapter_natural-language-processing/sentiment-analysis-cnn.md index 7670d3d..7de7801 100644 --- a/chapter_natural-language-processing/sentiment-analysis-cnn.md +++ b/chapter_natural-language-processing/sentiment-analysis-cnn.md @@ -185,11 +185,13 @@ d2l.predict_sentiment(net, vocab, ['this', 'movie', 'is', 'so', 'bad']) * 还能将textCNN应用于自然语言处理的哪些任务中? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7762) -![](../img/qr_sentiment-analysis-cnn.svg) ## 参考文献 [1] Kim, Y. (2014). Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7762) + +![](../img/qr_sentiment-analysis-cnn.svg) diff --git a/chapter_natural-language-processing/sentiment-analysis-rnn.md b/chapter_natural-language-processing/sentiment-analysis-rnn.md index 924d183..8657000 100644 --- a/chapter_natural-language-processing/sentiment-analysis-rnn.md +++ b/chapter_natural-language-processing/sentiment-analysis-rnn.md @@ -210,12 +210,14 @@ predict_sentiment(net, vocab, ['this', 'movie', 'is', 'so', 'bad']) * 使用spaCy分词工具,能否提升分类准确率?你需要安装spaCy(`pip install spacy`),并且安装英文包(`python -m spacy download en`)。在代码中,先导入spacy(`import spacy`)。然后加载spacy英文包(`spacy_en = spacy.load('en')`)。最后定义函数`def tokenizer(text): return [tok.text for tok in spacy_en.tokenizer(text)]`并替换原来的基于空格分词的`tokenizer`函数。需要注意的是,GloVe词向量对于名词词组的存储方式是用“-”连接各个单词,例如,词组“new york”在GloVe词向量中的表示为“new-york”,而使用spaCy分词之后“new york”的存储可能是“new york”。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6155) -![](../img/qr_sentiment-analysis.svg) ## 参考文献 [1] Maas, A. L., Daly, R. E., Pham, P. T., Huang, D., Ng, A. Y., & Potts, C. (2011, June). Learning word vectors for sentiment analysis. In Proceedings of the 49th annual meeting of the association for computational linguistics: Human language technologies-volume 1 (pp. 142-150). Association for Computational Linguistics. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6155) + +![](../img/qr_sentiment-analysis.svg) diff --git a/chapter_natural-language-processing/seq2seq.md b/chapter_natural-language-processing/seq2seq.md index 665e678..70a0e7b 100644 --- a/chapter_natural-language-processing/seq2seq.md +++ b/chapter_natural-language-processing/seq2seq.md @@ -77,12 +77,14 @@ $$- \log P(y_1, \ldots, y_{T'} \mid x_1, \ldots, x_T) = -\sum_{t'=1}^{T'} \log P * 有哪些方法可以设计解码器的输出层? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4523) -![](../img/qr_seq2seq.svg) ## 参考文献 [1] Cho, K., Van Merriënboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., & Bengio, Y. (2014). Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078. [2] Sutskever, I., Vinyals, O., & Le, Q. V. (2014). Sequence to sequence learning with neural networks. In Advances in neural information processing systems (pp. 3104-3112). + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4523) + +![](../img/qr_seq2seq.svg) diff --git a/chapter_natural-language-processing/similarity-analogy.md b/chapter_natural-language-processing/similarity-analogy.md index 1aca812..96d3183 100644 --- a/chapter_natural-language-processing/similarity-analogy.md +++ b/chapter_natural-language-processing/similarity-analogy.md @@ -129,9 +129,7 @@ get_analogy('do', 'did', 'go', glove_6b50d) * 如果词典特别大,如何提升近义词或类比词的搜索速度? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4373) -![](../img/qr_similarity-analogy.svg) ## 参考文献 @@ -140,3 +138,7 @@ get_analogy('do', 'did', 'go', glove_6b50d) [2] GloVe项目网站。 https://nlp.stanford.edu/projects/glove/ [3] fastText项目网站。 https://fasttext.cc/ + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4373) + +![](../img/qr_similarity-analogy.svg) diff --git a/chapter_natural-language-processing/word2vec-gluon.md b/chapter_natural-language-processing/word2vec-gluon.md index be6d87b..574294e 100644 --- a/chapter_natural-language-processing/word2vec-gluon.md +++ b/chapter_natural-language-processing/word2vec-gluon.md @@ -348,9 +348,7 @@ get_similar_tokens('chip', 3, net[0]) * 当数据集较大时,我们通常在迭代模型参数时才对当前小批量里的中心词采样背景词和噪声词。也就是说,同一个中心词在不同的迭代周期可能会有不同的背景词或噪声词。这样训练有哪些好处?尝试实现该训练方法。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7761) -![](../img/qr_word2vec-gluon.svg) ## 参考文献 @@ -358,3 +356,7 @@ get_similar_tokens('chip', 3, net[0]) [1] Penn Tree Bank. https://catalog.ldc.upenn.edu/ldc99t42 [2] Mikolov, T., Sutskever, I., Chen, K., Corrado, G. S., & Dean, J. (2013). Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems (pp. 3111-3119). + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7761) + +![](../img/qr_word2vec-gluon.svg) diff --git a/chapter_natural-language-processing/word2vec.md b/chapter_natural-language-processing/word2vec.md index 229c0b5..ab87d13 100644 --- a/chapter_natural-language-processing/word2vec.md +++ b/chapter_natural-language-processing/word2vec.md @@ -119,9 +119,7 @@ $$\frac{\partial \log\, P(w_c \mid \mathcal{W}_o)}{\partial \boldsymbol{v}_{o_i} * 让我们以跳字模型为例思考word2vec模型的设计。跳字模型中两个词向量的内积与余弦相似度有什么关系?对语义相近的一对词来说,为什么它们的词向量的余弦相似度可能会高? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4203) -![](../img/qr_word2vec.svg) ## 参考文献 @@ -131,3 +129,7 @@ $$\frac{\partial \log\, P(w_c \mid \mathcal{W}_o)}{\partial \boldsymbol{v}_{o_i} [2] Mikolov, T., Sutskever, I., Chen, K., Corrado, G. S., & Dean, J. (2013). Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems (pp. 3111-3119). [3] Mikolov, T., Chen, K., Corrado, G., & Dean, J. (2013). Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4203) + +![](../img/qr_word2vec.svg) diff --git a/chapter_optimization/adadelta.md b/chapter_optimization/adadelta.md index cb73e1c..8c1d80b 100644 --- a/chapter_optimization/adadelta.md +++ b/chapter_optimization/adadelta.md @@ -71,10 +71,12 @@ d2l.train_gluon_ch7('adadelta', {'rho': 0.9}, features, labels) * 调节AdaDelta算法中超参数$\rho$的值,观察实验结果。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/2277) -![](../img/qr_adadelta.svg) ## 参考文献 [1] Zeiler, M. D. (2012). ADADELTA: an adaptive learning rate method. arXiv preprint arXiv:1212.5701. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/2277) + +![](../img/qr_adadelta.svg) diff --git a/chapter_optimization/adagrad.md b/chapter_optimization/adagrad.md index 0b9da66..1587137 100644 --- a/chapter_optimization/adagrad.md +++ b/chapter_optimization/adagrad.md @@ -100,11 +100,13 @@ d2l.train_gluon_ch7('adagrad', {'learning_rate': 0.1}, features, labels) * 在实验中尝试使用其他的初始学习率,结果有什么变化? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/2273) -![](../img/qr_adagrad.svg) ## 参考文献 [1] Duchi, J., Hazan, E., & Singer, Y. (2011). Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul), 2121-2159. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/2273) + +![](../img/qr_adagrad.svg) diff --git a/chapter_optimization/adam.md b/chapter_optimization/adam.md index f9910c3..a658be7 100644 --- a/chapter_optimization/adam.md +++ b/chapter_optimization/adam.md @@ -82,10 +82,12 @@ d2l.train_gluon_ch7('adam', {'learning_rate': 0.01}, features, labels) * 有人说Adam算法是RMSProp算法与动量法的结合。想一想,这是为什么? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/2279) -![](../img/qr_adam.svg) ## 参考文献 [1] Kingma, D. P., & Ba, J. (2014). Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/2279) + +![](../img/qr_adam.svg) diff --git a/chapter_optimization/gd-sgd.md b/chapter_optimization/gd-sgd.md index 69fa0e7..d0de078 100644 --- a/chapter_optimization/gd-sgd.md +++ b/chapter_optimization/gd-sgd.md @@ -188,6 +188,8 @@ show_trace_2d(f_2d, train_2d(sgd_2d)) * 在二维梯度下降的实验中尝试使用不同的学习率,观察并分析实验现象。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1877) ![](../img/qr_gd-sgd.svg) diff --git a/chapter_optimization/index.md b/chapter_optimization/index.md index 29b25f1..f1aafcb 100644 --- a/chapter_optimization/index.md +++ b/chapter_optimization/index.md @@ -20,3 +20,7 @@ adadelta adam ``` + + + + diff --git a/chapter_optimization/minibatch-sgd.md b/chapter_optimization/minibatch-sgd.md index f7a386f..4e9b5a6 100644 --- a/chapter_optimization/minibatch-sgd.md +++ b/chapter_optimization/minibatch-sgd.md @@ -165,10 +165,12 @@ train_gluon_ch7('sgd', {'learning_rate': 0.05}, features, labels, 10) * 查阅MXNet文档,使用`Trainer`类的`set_learning_rate`函数,令小批量随机梯度下降的学习率每过一个迭代周期减小到原值的1/10。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/8013) -![](../img/qr_minibatch-sgd.svg) ## 参考文献 [1] 飞机机翼噪音数据集。https://archive.ics.uci.edu/ml/datasets/Airfoil+Self-Noise + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/8013) + +![](../img/qr_minibatch-sgd.svg) diff --git a/chapter_optimization/momentum.md b/chapter_optimization/momentum.md index f82284f..1f9bbec 100644 --- a/chapter_optimization/momentum.md +++ b/chapter_optimization/momentum.md @@ -160,6 +160,8 @@ d2l.train_gluon_ch7('sgd', {'learning_rate': 0.004, 'momentum': 0.9}, * 使用其他动量超参数和学习率的组合,观察并分析实验结果。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1879) ![](../img/qr_momentum.svg) diff --git a/chapter_optimization/optimization-intro.md b/chapter_optimization/optimization-intro.md index bff677e..6708eeb 100644 --- a/chapter_optimization/optimization-intro.md +++ b/chapter_optimization/optimization-intro.md @@ -116,11 +116,13 @@ d2l.plt.ylabel('y'); * 对于深度学习中的优化问题,你还能想到哪些其他的挑战? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1876) -![](../img/qr_optimization-intro.svg) ## 参考文献 [1] Wigner, E. P. (1958). On the distribution of the roots of certain symmetric matrices. Annals of Mathematics, 325-327. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1876) + +![](../img/qr_optimization-intro.svg) diff --git a/chapter_optimization/rmsprop.md b/chapter_optimization/rmsprop.md index 31a5d97..d683b2b 100644 --- a/chapter_optimization/rmsprop.md +++ b/chapter_optimization/rmsprop.md @@ -82,11 +82,13 @@ d2l.train_gluon_ch7('rmsprop', {'learning_rate': 0.01, 'gamma1': 0.9}, * 把$\gamma$的值设为1,实验结果有什么变化?为什么? * 试着使用其他的初始学习率和$\gamma$超参数的组合,观察并分析实验结果。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/2275) -![](../img/qr_rmsprop.svg) ## 参考文献 [1] Tieleman, T., & Hinton, G. (2012). Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning, 4(2), 26-31. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/2275) + +![](../img/qr_rmsprop.svg) diff --git a/chapter_prerequisite/autograd.md b/chapter_prerequisite/autograd.md index edb05bf..00ae525 100644 --- a/chapter_prerequisite/autograd.md +++ b/chapter_prerequisite/autograd.md @@ -100,6 +100,8 @@ a.grad == c / a * 重新设计一个对控制流求梯度的例子。运行并分析结果。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/744) ![](../img/qr_autograd.svg) diff --git a/chapter_prerequisite/index.md b/chapter_prerequisite/index.md index d9ad42b..58b8216 100644 --- a/chapter_prerequisite/index.md +++ b/chapter_prerequisite/index.md @@ -13,3 +13,7 @@ lookup-api ``` + + + + diff --git a/chapter_prerequisite/install.md b/chapter_prerequisite/install.md index ecd50cf..0a3a2df 100644 --- a/chapter_prerequisite/install.md +++ b/chapter_prerequisite/install.md @@ -130,6 +130,8 @@ conda env update -f environment.yml * 获取本书的代码并安装运行环境。如果你在安装时遇到任何问题,请扫一扫本节开始的二维码。在讨论区,你可以查阅疑难问题汇总或者提问。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/249) ![](../img/qr_install.svg) diff --git a/chapter_prerequisite/lookup-api.md b/chapter_prerequisite/lookup-api.md index 47ff55b..85e8cda 100644 --- a/chapter_prerequisite/lookup-api.md +++ b/chapter_prerequisite/lookup-api.md @@ -55,6 +55,8 @@ y * 查阅`NDArray`支持的其他操作。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7116) ![](../img/qr_lookup-api.svg) diff --git a/chapter_prerequisite/ndarray.md b/chapter_prerequisite/ndarray.md index b6b2994..36719e4 100644 --- a/chapter_prerequisite/ndarray.md +++ b/chapter_prerequisite/ndarray.md @@ -234,6 +234,8 @@ D.asnumpy() * 将广播机制中按元素运算的两个`NDArray`替换成其他形状,结果是否和预期一样? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/745) ![](../img/qr_ndarray.svg) diff --git a/chapter_recurrent-neural-networks/bi-rnn.md b/chapter_recurrent-neural-networks/bi-rnn.md index a9fdad3..4a3a771 100644 --- a/chapter_recurrent-neural-networks/bi-rnn.md +++ b/chapter_recurrent-neural-networks/bi-rnn.md @@ -35,6 +35,8 @@ $$\boldsymbol{O}_t = \boldsymbol{H}_t \boldsymbol{W}_{hq} + \boldsymbol{b}_q,$$ * 参考图6.11和图6.12,设计含多个隐藏层的双向循环神经网络。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6732) ![](../img/qr_bi-rnn.svg) diff --git a/chapter_recurrent-neural-networks/bptt.md b/chapter_recurrent-neural-networks/bptt.md index 88793d4..bb7d8da 100644 --- a/chapter_recurrent-neural-networks/bptt.md +++ b/chapter_recurrent-neural-networks/bptt.md @@ -105,6 +105,8 @@ $$ * 除了梯度裁剪,你还能想到别的什么方法应对循环神经网络中的梯度爆炸? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/3711) ![](../img/qr_bptt.svg) diff --git a/chapter_recurrent-neural-networks/deep-rnn.md b/chapter_recurrent-neural-networks/deep-rnn.md index b008776..7a92a3c 100644 --- a/chapter_recurrent-neural-networks/deep-rnn.md +++ b/chapter_recurrent-neural-networks/deep-rnn.md @@ -37,6 +37,8 @@ $$\boldsymbol{O}_t = \boldsymbol{H}_t^{(L)} \boldsymbol{W}_{hq} + \boldsymbol{b} * 将[“循环神经网络的从零开始实现”](rnn-scratch.md)一节中的模型改为含有2个隐藏层的循环神经网络。观察并分析实验现象。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6730) ![](../img/qr_deep-rnn.svg) diff --git a/chapter_recurrent-neural-networks/gru.md b/chapter_recurrent-neural-networks/gru.md index 293210e..2e12c1d 100644 --- a/chapter_recurrent-neural-networks/gru.md +++ b/chapter_recurrent-neural-networks/gru.md @@ -177,12 +177,14 @@ d2l.train_and_predict_rnn_gluon(model, num_hiddens, vocab_size, ctx, * 在相同条件下,比较门控循环单元和不带门控的循环神经网络的运行时间。 -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4042) -![](../img/qr_gru.svg) ## 参考文献 [1] Cho, K., Van Merriënboer, B., Bahdanau, D., & Bengio, Y. (2014). On the properties of neural machine translation: Encoder-decoder approaches. arXiv preprint arXiv:1409.1259. [2] Chung, J., Gulcehre, C., Cho, K., & Bengio, Y. (2014). Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4042) + +![](../img/qr_gru.svg) diff --git a/chapter_recurrent-neural-networks/index.md b/chapter_recurrent-neural-networks/index.md index cd1cb6d..6fa7598 100644 --- a/chapter_recurrent-neural-networks/index.md +++ b/chapter_recurrent-neural-networks/index.md @@ -22,3 +22,7 @@ deep-rnn bi-rnn ``` + + + + diff --git a/chapter_recurrent-neural-networks/lang-model-dataset.md b/chapter_recurrent-neural-networks/lang-model-dataset.md index e212fc9..d16b54b 100644 --- a/chapter_recurrent-neural-networks/lang-model-dataset.md +++ b/chapter_recurrent-neural-networks/lang-model-dataset.md @@ -123,6 +123,8 @@ for X, Y in data_iter_consecutive(my_seq, batch_size=2, num_steps=6): * 你还能想到哪些采样小批量时序数据的方法? * 如果我们希望一个序列样本是一个完整的句子,这会给小批量采样带来什么样的问题? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7876) ![](../img/qr_lang-model-dataset.svg) diff --git a/chapter_recurrent-neural-networks/lang-model.md b/chapter_recurrent-neural-networks/lang-model.md index 1d5c17d..ff9e39e 100644 --- a/chapter_recurrent-neural-networks/lang-model.md +++ b/chapter_recurrent-neural-networks/lang-model.md @@ -55,6 +55,8 @@ $$ * 你还能想到哪些语言模型的应用? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6650) ![](../img/qr_lang-model.svg) diff --git a/chapter_recurrent-neural-networks/lstm.md b/chapter_recurrent-neural-networks/lstm.md index d51ce5e..991a586 100644 --- a/chapter_recurrent-neural-networks/lstm.md +++ b/chapter_recurrent-neural-networks/lstm.md @@ -191,10 +191,12 @@ d2l.train_and_predict_rnn_gluon(model, num_hiddens, vocab_size, ctx, * 既然候选记忆细胞已通过使用tanh函数确保值域在-1到1之间,为什么隐藏状态还需要再次使用tanh函数来确保输出值域在-1到1之间? -## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4049) -![](../img/qr_lstm.svg) ## 参考文献 [1] Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8), 1735-1780. + +## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4049) + +![](../img/qr_lstm.svg) diff --git a/chapter_recurrent-neural-networks/rnn-gluon.md b/chapter_recurrent-neural-networks/rnn-gluon.md index d18d65f..b08788e 100644 --- a/chapter_recurrent-neural-networks/rnn-gluon.md +++ b/chapter_recurrent-neural-networks/rnn-gluon.md @@ -156,6 +156,8 @@ train_and_predict_rnn_gluon(model, num_hiddens, vocab_size, ctx, * 与上一节的实现进行比较。看看Gluon的实现是不是运行速度更快?如果你觉得差别明显,试着找找原因。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/4089) ![](../img/qr_rnn-gluon.svg) diff --git a/chapter_recurrent-neural-networks/rnn-scratch.md b/chapter_recurrent-neural-networks/rnn-scratch.md index 7353f00..8be68ac 100644 --- a/chapter_recurrent-neural-networks/rnn-scratch.md +++ b/chapter_recurrent-neural-networks/rnn-scratch.md @@ -259,6 +259,8 @@ train_and_predict_rnn(rnn, get_params, init_rnn_state, num_hiddens, * 将本节中使用的激活函数替换成ReLU,重复本节的实验。 + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/989) ![](../img/qr_rnn-scratch.svg) diff --git a/chapter_recurrent-neural-networks/rnn.md b/chapter_recurrent-neural-networks/rnn.md index 2b404a6..558a942 100644 --- a/chapter_recurrent-neural-networks/rnn.md +++ b/chapter_recurrent-neural-networks/rnn.md @@ -73,6 +73,8 @@ nd.dot(nd.concat(X, H, dim=1), nd.concat(W_xh, W_hh, dim=0)) * 如果使用循环神经网络来预测一段文本序列的下一个词,输出个数应该设为多少? * 为什么循环神经网络可以表达某时间步的词基于文本序列中所有过去的词的条件概率? + + ## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6669) ![](../img/qr_rnn.svg) -- GitLab