快乐学习 一个网站喵查铺子(catpuzi.com)全搞定~

中国大学MOOC 人工智能实践:Tensorflow笔记-北京大学 测验与作业答案

中国大学MOOC答案 mooc君 2023-10-31 扫描二维码
文章目录[隐藏]

第一讲 神经网络计算

1 该张量的维度是 [[ 1.3688478   1.0125661 ] [ 0.17475659 -0.02224463]]

(2,1)
喵查答案:(2,2)
(1,2)
(4,1)

2 人工智能主流的三个学派是什么?
喵查答案:行为主义    
计算主义
喵查答案:连接主义
喵查答案:符号主义

3 以下语句实现了损失函数loss 分别对可训练参数w1和b1求偏导数,并将计算结果保存到grads列表中。with tf.GradientTape() as tape:      前向传播过程计算y    计算总lossgrads = tape.gradient(loss, [ w1, b1 ])
喵查答案:正确
错误

4 神经网络可以让计算机具备感性思维,能实现图像识别、趋势预测。
喵查答案:正确
错误

5 设计神经网络的步骤包括:准备数据、搭建网络、优化参数、应用网络。
喵查答案:正确
错误

第二讲 神经网络优化

1 tf.nn.relu([[-2., 1.], [0., 3.]])的计算结果是哪个?
tf.Tensor([ -2.  1.  0.  3.], shape=(4,), dtype=float32)
tf.Tensor([ 0.  1.  0.  3.], shape=(4,), dtype=float32)
tf.Tensor([ [-2.  1.] [0.  3.] ], shape=(2,2), dtype=float32)
喵查答案:tf.Tensor([ [0.  1.] [0.  3.] ], shape=(2,2), dtype=float32)

2 下列哪一项是均方误差损失函数的代码实现?
喵查答案:tf.reduce_mean(tf.square(y_true – y_pred))
tf.reduce_mean(tf.abs(y_true-y_pred))
-tf.reduce_sum(y_true * tf.math.log(y_pred))
-tf.reduce_sum(labels * tf.math.log(tf.nn.softmax(logits)), axis=1)

3 在某个三分类问题中,已知真实标签y_=(0, 0, 1),神经网络预测值分别为y1=(0.51, 0.32, 0.17),y2=(0.22, 0.73, 0.05),y3=(0.15, 0.17, 0.68),y4=(0.04, 0.03, 0.93),哪个预测值更接近真实标签?
y1
y2
y3
喵查答案:y4

4 下列属于神经网络优化器的有?
喵查答案:SGD
喵查答案:AdaGrad
喵查答案:RMSProp
喵查答案:Adam

5 解决过拟合问题的方法有:
喵查答案:增大训练集
喵查答案:采用正则化
增加网络参数
减小正则化参数

第三讲 神经网络八股

1 如果标签以数值形式给出,模型推理结果以概率形式给出,则model.compile()函数中metrics参数应选择哪一项?
‘sparse_categorical_crossentropy’
 ‘accuracy’
‘categorical_accuracy’
喵查答案:‘sparse_ categorical_accuracy’

2 使用Sequential()函数搭建神经网络训练MNIST数据集的代码为:
model = tf.keras.models.Sequential([    tf.keras.layers.Flatten(),     tf.keras.layers.Dense(128, activation=’relu’),     tf.keras.layers.Dense(10, activation=’softmax’)])
请问使用model.summary()打印网络结构和参数统计中,Total params的数目为?

100480
1280
喵查答案:101770
101632

3 以下数据为训练过程中某个epoch的最终输出,其中最能直观有效反映网络准确度的数据是?60000/60000 [==============================]- 4s 68us/sample- loss: 0.2916- sparse_categorical_accuracy: 0.8920- val_loss: 0.3387- val_sparse_categorical_accuracy: 0.8770
0.2916
0.8920
0.3387
喵查答案:0.8770

4 以下关于MNIST数据集和Fashion_mnist数据集描述正确的是?
喵查答案:MNIST数据集一共包括7万张图片,其中6万张用于训练,1万张用于测试。
每张图片包括
1024(32×32)个像素点。
喵查答案:MNIST数据集是为09的手写数字数据集。
Fashion_mnist数据集中的图片被分为20类。

5 本课中搭建神经网络六步法包括如下步骤:1、import2、train, test3、Sequential / Class4、model.compile5、model.fit6、model.summary
喵查答案:正确
错误

关注工众号

喵查

查看更多答案

喜欢 (0)
关于作者: