【中英】【吴恩达课后测验】Course 4 -卷积神经网络 - 第一周测验

【中英】【吴恩达课后测验】Course 4 -卷积神经网络 - 第一周测验 - 卷积神经网络的基本知识


上一篇:【课程3 - 第二周测验】※※※※※ 【回到目录】※※※※※下一篇:【课程4 -第一周编程作业】

第一周测验 - 卷积神经网络的基本知识

1. 问题 1

你认为把下面这个过滤器应用到灰度图像会怎么样?
[0110 1331 1331 0110]

  • 【 】 会检测45度边缘

  • 】 会检测垂直边缘

  • 【 】 会检测水平边缘

  • 【 】 会检测图像对比度

Because the left part is positive, and the right part is negative.


因为因为左边的部分是正的,右边的部分是负的。(博主注:左边亮,右边暗)

2. 问题 2

  假设你的输入是一个300×300的彩色(RGB)图像,而你没有使用卷积神经网络。 如果第一个隐藏层有100个神经元,每个神经元与输入层进行全连接,那么这个隐藏层有多少个参数(包括偏置参数)?

  • 【 】 9,000,001

  • 【 】 9,000,100

  • 【 】 27,000,001

  • 】 27,000,100

  博主注:先计算W[1]=[l[1],X]=[100,3003003]=1003003003=27,000,000,然后计算偏置b,因为第一隐藏层有100个节点,每个节点有1个偏置参数,所以b=100,加起来就是27,000,000+100=27,000,100

3. 问题 3

  假设你的输入是300×300彩色(RGB)图像,并且你使用卷积层和100个过滤器,每个过滤器都是5×5的大小,请问这个隐藏层有多少个参数(包括偏置参数)?

  • 【 】 2501

  • 【 】 2600

  • 【 】 7500

  • 】 7600

  博主注:视频【1.7单层卷积网络】,05:10处。首先,参数和输入的图片大小是没有关系的,无论你给的图像像素有多大,参数值都是不变的,在这个题中,参数值只与过滤器有关。我们来看一下怎么算:单片过滤器的大小是55,由于输入的是RGB图像,所以信道nc=3,由此可见,一个完整的过滤器的组成是:55nc=553,每一个完整的过滤器只有一个偏置参数b,所以,每一个完整的过滤器拥有553+1=76个参数,而此题中使用了100个过滤器,所以这个隐藏层包含了76100=7600个参数。

4. 问题 4

你有一个63x63x16的输入,并使用大小为7x7的32个过滤器进行卷积,使用步幅为2和无填充,请问输出是多少?

  • 】 29x29x32

  • 【 】 16x16x32

  • 【 】 29x29x16

  • 【 】 16x16x16

n = 63, f = 7, s = 2, p = 0, 32 filters.

  博主注:我们先来看一下这个输出尺寸的公式:$\left \lfloor \frac{n_h + 2p - f}{s} + 1 \right \rfloor \times \left \lfloor \frac{n_w + 2p - f}{s} + 1 \right \rfloor \left \lfloor \frac {63 + 2\times0 - 7}{2} + 1 \right \rfloor \times \left \lfloor \frac {63 + 2\times0 - 7}{2} + 1 \right \rfloor = \left \lfloor \frac{56}{2} + 1 \right \rfloor \times \left \lfloor \frac{56}{2} + 1 \right \rfloor = 29 \times 29$,由于有32个过滤器,所以输出为29×29×32

5. 问题 5

你有一个15x15x8的输入,并使用“pad = 2”进行填充,填充后的尺寸是多少?

  • 【 】 17x17x10

  • 】 19x19x8

  • 【 】 19x19x12

  • 【 】 17x17x8

6. 问题 6

  你有一个63x63x16的输入,有32个过滤器进行卷积,每个过滤器的大小为7x7,步幅为1,你想要使用“same”的卷积方式,请问pad的值是多少?

  • 【 】 1

  • 【 】 2

  • 】 3

  • 【 】 7

  博主注:“same”的卷积方式就是卷积前后的大小不变,也就是63x63x16的输入进行卷积后的大小依旧为63x63x16,这需要我们对输入过来的数据进行填充处理。我们来看一下这个输出尺寸的公式(假设输入图像的宽、高相同):$\left \lfloor \frac{n + 2p - f}{s} + 1 \right \rfloor pp = \frac {s \times n - n - s + f}{2} = \frac{1 \times 63 - 63 -1 + 7}{2} = \frac{6}{2} = 3$。

7. 问题 7

你有一个32x32x16的输入,并使用步幅为2、过滤器大小为2的最大化池,请问输出是多少?

  • 【 】 15x15x16

  • 【 】 16x16x8

  • 】 16x16x16

  • 【 】 32x32x8

8. 问题 8

因为池化层不具有参数,所以它们不影响反向传播的计算。

  • 【 】 正确

  • 】 错误

  博主注:由卷积层->池化层作为一个layer,在前向传播过程中,池化层里保存着卷积层的各个部分的最大值/平均值,然后由池化层传递给下一层,在反向传播过程中,由下一层传递梯度过来,“不影响反向传播的计算”这意味着池化层到卷积层(反向)没有梯度变化,梯度值就为0,既然梯度值为0,那么例如在W[l]=W[l]α×dW[l]的过程中,参数W[l]=W[l]α×0,也就是说它不再更新,那么反向传播到此中断。所以池化层会影响反向传播的计算。

9. 问题 9

在视频中,我们谈到了“参数共享”是使用卷积网络的好处。关于参数共享的下列哪个陈述是正确的?(检查所有选项。

  • 【 】 它减少了参数的总数,从而减少过拟合。

  • 】 它允许在整个输入值的多个位置使用特征检测器。

  • 【 】 它允许为一项任务学习的参数即使对于不同的任务也可以共享(迁移学习)。

  • 】 它允许梯度下降将许多参数设置为零,从而使得连接稀疏。

10. 问题 10

在课堂上,我们讨论了“稀疏连接”是使用卷积层的好处。这是什么意思?

  • 【 】 正则化导致梯度下降将许多参数设置为零。

  • 【 】 每个过滤器都连接到上一层的每个通道。

  • 】 下一层中的每个激活只依赖于前一层的少量激活。

  • 【 】 卷积网络中的每一层只连接到另外两层。


Week 1 quiz - The basics of ConvNets

1. Question 1

What do you think applying this filter to a grayscale image will do?

[0110 1331 1331 0110]

Because the left part is positive, and the right part is negative.

2. Question 2

Suppose your input is a 300 by 300 color (RGB) image, and you are not using a convolutional network. If the first hidden layer has 100 neurons, each one fully connected to the input, how many parameters does this hidden layer have (including the bias parameters)?

3. Question 3

Suppose your input is a 300 by 300 color (RGB) image, and you use a convolutional layer with 100 filters that are each 5x5. How many parameters does this hidden layer have (including the bias parameters)?

4. Question 4

You have an input volume that is 63x63x16, and convolve it with 32 filters that are each 7x7, using a stride of 2 and no padding. What is the output volume?

n = 63, f = 7, s = 2, p = 0, 32 filters.

5. Question 5

You have an input volume that is 15x15x8, and pad it using “pad=2.” What is the dimension of the resulting volume (after padding)?

6. Question 6

You have an input volume that is 63x63x16, and convolve it with 32 filters that are each 7x7, and stride of 1. You want to use a “same” convolution. What is the padding?

7. Question 7

You have an input volume that is 32x32x16, and apply max pooling with a stride of 2 and a filter size of 2. What is the output volume?

8. Question 8

Because pooling layers do not have parameters, they do not affect the backpropagation (derivatives) calculation.

Go to this page for further information.

9. Question 9

In lecture we talked about “parameter sharing” as a benefit of using convolutional networks. Which of the following statements about parameter sharing in ConvNets are true? (Check all that apply.)

10. Question 10

In lecture we talked about “sparsity of connections” as a benefit of using convolutional layers. What does this mean?

posted @   何宽  阅读(156)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
点击右上角即可分享
微信分享提示