【深度学习】吴恩达深度学习-Course1神经网络与深度学习-第四周深度神经网络的关键概念作业

视频链接:【中英字幕】吴恩达深度学习课程第一课 — 神经网络与深度学习
本文题目来源:【中英】【吴恩达课后测验】Course 1 - 神经网络和深度学习 - 第四周测验

英文习题

1.What is the “cache” used for in our implementation of forward propagation and backward propagation?
A.It is used to cache the intermediate values of the cost function during training.
B.We use it to pass variables computed during forward propagation to the corresponding backward propagation step. It contains useful values for backward propagation to compute derivatives.
C.It is used to keep track of the hyperparameters that we are searching over, to speed up computation.
D.We use it to pass variables computed during backward propagation to the corresponding forward propagation step. It contains useful values for forward propagation to compute activations.

2.Among the following, which ones are “hyperparameters”? (Check all that apply.) I only list correct options.
A.size of the hidden layers n[l]
B.learning rate α
C.number of iterations
D.number of layers L in the neural network

3.Which of the following statements is true?
A.The deeper layers of a neural network are typically computing more complex features of the input than the earlier layers.
B.The earlier layers of a neural network are typically computing more complex features of the input than the deeper layers.

4.Vectorization allows you to compute forward propagation in an L-layer neural network without an explicit for-loop (or any other explicit iterative loop) over the layers l=1, 2, …,L. True/False?
A.True
B.False

5.Assume we store the values for n^ [l] in an array called layers, as follows: layer_dims = [n_x, 4,3,2,1]. So layer 1 has four hidden units, layer 2 has 3 hidden units and so on. How to use for-loops to initialize the parameters for the model?

for(i in range(1, len(layer_dims))):
    parameter[‘W’ + str(i)] = np.random.randn(layers[i], layers[i - 1])) * 0.01
    parameter[‘b’ + str(i)] = np.random.randn(layers[i], 1) * 0.01

6.Consider the following neural network.
A.The number of layers L is 4. The number of hidden layers is 3.
B.The number of layers L is 3. The number of hidden layers is 4.
C.The number of layers L is 3. The number of hidden layers is 3.
D.The number of layers L is 4. The number of hidden layers is 4.

7.During forward propagation, in the forward function for a layer l you need to know what is the activation function in a layer (Sigmoid, tanh, ReLU, etc.). During backpropagation, the corresponding backward function also needs to know what is the activation function for layer l, since the gradient depends on it. True/False?
A.True
B.False

8.There are certain functions with the following properties:
(i) To compute the function using a shallow network circuit, you will need a large network (where we measure size by the number of logic gates in the network), but (ii) To compute it using a deep network circuit, you need only an exponentially smaller network. True/False?
A.True
B.False


9.Consider the following 2 hidden layer neural network:
Which of the following statements are True? (Check all that apply).

在这里插入图片描述

A.W^ [1] will have shape (4, 4)
B.b^ [1] will have shape (4, 1)
C.W^ [2] will have shape (3, 4)
D.b^ [2] will have shape (3, 1)
E.b^ [3] will have shape (1, 1)
F.W^ [3] will have shape (1, 3)


10.Whereas the previous question used a specific network, in the general case what is the dimension of W^ [l], the weight matrix associated with layer l?


中文习题

1.在实现前向传播和反向传播中使用的“cache”是什么?
A.用于在训练期间缓存成本函数的中间值。
B.我们用它传递前向传播中计算的变量到相应的反向传播步骤,它包含用于计算导数的反向传播的有用值。
C.它用于跟踪我们正在搜索的超参数,以加速计算。
D.我们使用它将向后传播计算的变量传递给相应的正向传播步骤,它包含用于计算计算激活的正向传播的有用值。

2.以下哪些是“超参数”?
A.隐藏层的大小n[l]
B.学习率α
C.迭代次数
D.神经网络中的层数L

3.下列哪个说法是正确的?
A.神经网络的更深层通常比前面的层计算更复杂的输入特征。
B.神经网络的前面的层通常比更深层计算输入的更复杂的特性。

4.向量化允许您在L层神经网络中计算前向传播,而不需要在层(l = 1,2,…,L)上显式的使用for-loop(或任何其他显式迭代循环),正确吗?
A.正确
B.错误


5.假设我们将n^ [l]的值存储在名为layers的数组中,如下所示:layer_dims = [n_x,4,3,2,1]。 因此,第1层有四个隐藏单元,第2层有三个隐藏单元,依此类推。 怎么for循环初始化模型参数?


6.下面关于神经网络的说法正确的是
A.层数L为4,隐藏层数为3
B.层数L为3,隐藏层数为4
C.层数L为3,隐藏层数为3
D.层数L为4,隐藏层数为4

7.在前向传播期间,在层l的前向传播函数中,您需要知道层l中的激活函数(Sigmoid,tanh,ReLU等)是什么, 在反向传播期间,相应的反向传播函数也需要知道第l层的激活函数是什么,因为梯度是根据它来计算的,正确吗?
A.正确
B.错误


8.有一些确定的函数具有以下特征
(i) 使用浅层网络进行计算函数(我们通过在网络中的逻辑门数量来测得大小), 但 (ii) 用于使用深层网络计算,你只需要一个指数型的小的神经网络。对还是错?
A.正确
B.错误


9.在2层隐层神经网络中,下列哪个说法是正确的?:
在这里插入图片描述

A.W^ [1] will have shape (4, 4)
B.b^ [1] will have shape (4, 1)
C.W^ [2] will have shape (3, 4)
D.b^ [2] will have shape (3, 1)
E.b^ [3] will have shape (1, 1)
F.W^ [3] will have shape (1, 3)


10.前面的问题使用了一个特定的网络,与层l有关的权重矩阵在一般情况下,W[l]的维数是多少


答案

  1. B。“cache”记录来自正向传播单元的值并将其发送到反向传播单元,因为需要链式计算导数。
  2. ABCD。请注意:你可以查看Quora的这篇文章 或者 这篇博客.
  3. A。你可以查看视频,我想用吴恩达的用深层神经网络的例子来解释这个。
  4. B。矩阵化带来的好处是并行计算,而每一层的计算需要前面层的结果,无法矩阵化无法并行计算。在层间计算中,我们不能避免for循环迭代。
for(i in range(1, len(layer_dims))):
  parameter[‘W’ + str(i)] = np.random.randn(layers[i], layers[i - 1])) * 0.01
  parameter[‘b’ + str(i)] = np.random.randn(layers[i], 1) * 0.01

需要注意的是randn不能写成rand!!np.random.randn()是生成标准状态分布,取值大多在-3~ +3之间,有负有正;而np.random.rand()则是生成0~1之间的随机均匀分布。

  1. A。正如视频中所看到的那样,层数被计为隐藏层数+1。输入层和输出层不计为隐藏层。
  2. A。在反向传播期间,您需要知道正向传播中使用哪种激活函数才能计算正确的导数。
  3. A。真实看不懂这题的意思。给出的注释是:请注意:参见视频,完全相同的题。
  4. ABCDEF。没问题,是老师上课给出的公式
  5. W[l]的维度是 (n[l],n[l−1])。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值