提交 b50c81ba 编写于 作者: A Aston Zhang

qr code at the end of each sectioin

上级 ad814c93
......@@ -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)
......@@ -50,6 +50,8 @@ GPU的性能主要由以下3个参数构成。
* 浏览本节讨论区中大家有关机器配置方面的交流。
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1177)
![](../img/qr_buy-gpu.svg)
......@@ -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)
......@@ -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)
......@@ -13,3 +13,7 @@
how-to-contribute
d2lzh
```
......@@ -113,6 +113,8 @@ jupyter nbextension enable execute_time/ExecuteTime
* 尝试在本地编辑和运行本书的代码。
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6965)
![](../img/qr_jupyter.svg)
......@@ -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)
......@@ -53,3 +53,7 @@
## 复杂度
* $\mathcal{O}$:大O符号(渐进符号)
......@@ -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)
......@@ -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)
......@@ -210,6 +210,8 @@ net(x)
* 回顾前面几章中你感兴趣的模型,改用`HybridBlock`类或`HybridSequential`类实现。
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1665)
![](../img/qr_hybridize.svg)
......@@ -13,3 +13,7 @@
multiple-gpus
multiple-gpus-gluon
```
......@@ -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)
......@@ -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)
......@@ -230,6 +230,8 @@ for i in output[0].asnumpy():
* 修改“标注训练集的锚框”与“输出预测边界框”两小节中的变量`anchors`,结果有什么变化?
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7024)
![](../img/qr_anchor.svg)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -23,3 +23,7 @@
kaggle-gluon-cifar10
kaggle-gluon-dog
```
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -152,6 +152,8 @@ conv2d.weight.data().reshape((1, 2))
* 如何通过变化输入和核数组将互相关运算表示成一个矩阵乘法?
* 如何构造一个全连接层来进行物体边缘检测?
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6314)
![](../img/qr_conv-layer.svg)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -92,6 +92,8 @@ comp_conv2d(conv2d, X).shape
* 对本节最后一个例子通过形状计算公式来计算输出形状,看看是否和实验结果一致。
* 在本节实验中,试一试其他的填充和步幅组合。
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6404)
![](../img/qr_padding-and-strides.svg)
......@@ -115,6 +115,8 @@ pool2d(X)
* 想一想,最大池化层和平均池化层在作用上可能有哪些区别?
* 你觉得最小池化层这个想法有没有意义?
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6406)
![](../img/qr_pooling.svg)
......@@ -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)
......@@ -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)
......@@ -121,6 +121,8 @@ $$
* 在本节样例模型的隐藏层和输出层中添加偏差参数,修改计算图以及正向传播和反向传播的数学表达式。
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/3710)
![](../img/qr_backprop.svg)
......@@ -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)
......@@ -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)
......@@ -27,3 +27,7 @@
kaggle-house-price
```
......@@ -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)
......@@ -132,6 +132,8 @@ true_b, dense.bias.data()
* 如何访问`dense.weight`的梯度?
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/742)
![](../img/qr_linear-regression-gluon.svg)
......@@ -170,6 +170,8 @@ true_b, b
* 如果样本个数不能被批量大小整除,`data_iter`函数的行为会有什么变化?
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/743)
![](../img/qr_linear-regression-scratch.svg)
......@@ -206,6 +206,8 @@ $$
* 使用其他包(如NumPy)或其他编程语言(如MATLAB),比较相加两个向量的两种方法的运行时间。
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6321)
![](../img/qr_linear-regression.svg)
......@@ -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)
......@@ -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)
......@@ -151,6 +151,8 @@ $$
* 查阅资料,了解其他的激活函数。
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6447)
![](../img/qr_mlp.svg)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -177,6 +177,8 @@ fit_and_plot_gluon(3)
* 如果你了解贝叶斯统计,你觉得权重衰减对应贝叶斯统计里的哪个重要概念?
* 调节实验中的权重衰减超参数,观察并分析实验结果。
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/984)
![](../img/qr_weight-decay.svg)
......@@ -103,6 +103,8 @@ net(nd.random.uniform(shape=(2, 64)))
* 自定义一个层,使用它做一次前向计算。
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1256)
![](../img/qr_custom-layer.svg)
......@@ -75,6 +75,8 @@ net.initialize(init=MyInit())
* 如果在下一次前向计算`net(X)`前改变输入`X`的形状,包括批量大小和输入个数,会发生什么?
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6320)
![](../img/qr_deferred-init.svg)
......@@ -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)
......@@ -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)
......@@ -90,6 +90,8 @@ Y2 == Y
* 即使无须把训练好的模型部署到不同的设备,存储模型参数在实际中还有哪些好处?
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/1255)
![](../img/qr_read-write.svg)
......@@ -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)
......@@ -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)
......@@ -51,6 +51,8 @@
* 在本书的学习社区 https://discuss.gluon.ai/ 上注册一个账号。搜索关键字Kaggle,浏览其中回复量最大的几个帖子。
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/6915)
![](../img/qr_how-to-use.svg)
......@@ -14,3 +14,7 @@
how-to-use
```
......@@ -74,3 +74,7 @@
阿斯顿·张、李沐、扎卡里 C. 立顿、亚历山大 J. 斯莫拉
2018年12月
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -22,3 +22,7 @@
attention
machine-translation
```
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -20,3 +20,7 @@
adadelta
adam
```
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -100,6 +100,8 @@ a.grad == c / a
* 重新设计一个对控制流求梯度的例子。运行并分析结果。
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/744)
![](../img/qr_autograd.svg)
......@@ -13,3 +13,7 @@
lookup-api
```
......@@ -130,6 +130,8 @@ conda env update -f environment.yml
* 获取本书的代码并安装运行环境。如果你在安装时遇到任何问题,请扫一扫本节开始的二维码。在讨论区,你可以查阅疑难问题汇总或者提问。
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/249)
![](../img/qr_install.svg)
......@@ -55,6 +55,8 @@ y
* 查阅`NDArray`支持的其他操作。
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/7116)
![](../img/qr_lookup-api.svg)
......@@ -234,6 +234,8 @@ D.asnumpy()
* 将广播机制中按元素运算的两个`NDArray`替换成其他形状,结果是否和预期一样?
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/745)
![](../img/qr_ndarray.svg)
......@@ -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)
......@@ -105,6 +105,8 @@ $$
* 除了梯度裁剪,你还能想到别的什么方法应对循环神经网络中的梯度爆炸?
## 扫码直达[讨论区](https://discuss.gluon.ai/t/topic/3711)
![](../img/qr_bptt.svg)
......@@ -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)
......@@ -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)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册