吴恩达《深度学习》-课后测验-第一门课 (Neural Networks and Deep Learning)-Week 2 - Neural Network Basics(第二周测验 - 神经网络基础)

时间:2022-11-10 11:38:15

Week 2 Quiz - Neural Network Basics(第二周测验 - 神经网络基础)

1. What does a neuron compute?(神经元节点计算什么?)

【 】 A neuron computes an activation function followed by a linear function (z = Wx + b)(神经 元节点先计算激活函数,再计算线性函数(z = Wx + b))

【 】 A neuron computes a linear function (z = Wx + b) followed by an activation function(神经 元节点先计算线性函数(z = Wx + b),再计算激活。)

【 】 A neuron computes a function g that scales the input x linearly (Wx + b)(神经元节点计算 函数 g,函数 g 计算(Wx + b))

【 】 A neuron computes the mean of all features before applying the output to an activation function(在 将输出应用于激活函数之前,神经元节点计算所有特征的平均值)

答案

【【★】 A neuron computes a linear function (z = Wx + b) followed by an activation function(神经 元节点先计算线性函数(z = Wx + b),再计算激活。)

Note: The output of a neuron is a = g(Wx + b) where g is the activation function (sigmoid, tanh, ReLU, …).(注:神经元的输出是 a = g(Wx + b),其中 g 是激活函数(sigmoid,tanh, ReLU,…))

 

\2. Which of these is the “Logistic Loss”?(下面哪一个是 Logistic 损失?)

【 】损失函数:\(L(\hat{y}^{(i)},y^{(i)})=-y^{(i)}log\hat{y}^{(i)}-(1-y^{(i)})log(1-\hat{y}^{(i)})\)

Note: We are using a cross-entropy loss function.(注:我们使用交叉熵损失函数。)

 

\3. Suppose img is a (32,32,3) array, representing a 32x32 image with 3 color channels red, green and blue. How do you reshape this into a column vector?(假设 img 是一个(32,32,3) 数组,具有 3 个颜色通道:红色、绿色和蓝色的 32x32 像素的图像。 如何将其重新转换为 列向量?)

答案

x = img.reshape((32 * 32 * 3, 1))

 

\4. Consider the two following random arrays “a” and “b”:(看一下下面的这两个随机数组“a”和 “b”:)

a = np.random.randn(2, 3) # a.shape = (2, 3)
b = np.random.randn(2, 1) # b.shape = (2, 1)
c = a + b

What will be the shape of “c”?(请问数组 c 的维度是多少?)

答案

c.shape = (2, 3)

b (column vector) is copied 3 times so that it can be summed to each column of a.
Therefore, c.shape = (2, 3).( B(列向量)复制 3 次,以便它可以和 A 的每一列相加,所
以:c.shape = (2, 3))

 

\5. Consider the two following random arrays “a” and “b”:(看一下下面的这两个随机数组“a”和 “b”)

a = np.random.randn(4, 3) # a.shape = (4, 3)
b = np.random.randn(3, 2) # b.shape = (3, 2)
c = a * b

What will be the shape of “c”?(请问数组“c”的维度是多少?)

答案

The computation cannot happen because the sizes don’t match. It’s going to be “error”!
Note:“*” operator indicates element-wise multiplication. Element-wise multiplication requires same
dimension between two matrices. It’s going to be an error.(注:运算符 “*” 说明了按元素乘法来相
乘,但是元素乘法需要两个矩阵之间的维数相同,所以这将报错,无法计算。)

 

\6. Suppose you have

吴恩达《深度学习》-课后测验-第一门课 (Neural Networks and Deep Learning)-Week 2 - Neural Network Basics(第二周测验 - 神经网络基础)的更多相关文章

  1. 吴恩达深度学习课后习题第5课第1周第3小节: Jazz Improvisation with LSTM

    目录 Improvise a Jazz Solo with an LSTM Network Packages 1 - Problem Statement 1.1 - Dataset What are ...

  2. 【Deeplearning.ai 】吴恩达深度学习笔记及课后作业目录

    吴恩达深度学习课程的课堂笔记以及课后作业 代码下载:https://github.com/douzujun/Deep-Learning-Coursera 吴恩达推荐笔记:https://mp.weix ...

  3. 吴恩达深度学习第2课第2周编程作业 的坑(Optimization Methods)

    我python2.7, 做吴恩达深度学习第2课第2周编程作业 Optimization Methods 时有2个坑: 第一坑 需将辅助文件 opt_utils.py 的 nitialize_param ...

  4. 吴恩达深度学习第1课第4周-任意层人工神经网络(Artificial Neural Network,即ANN)(向量化)手写推导过程(我觉得已经很详细了)

    学习了吴恩达老师深度学习工程师第一门课,受益匪浅,尤其是吴老师所用的符号系统,准确且易区分. 遵循吴老师的符号系统,我对任意层神经网络模型进行了详细的推导,形成笔记. 有人说推导任意层MLP很容易,我 ...

  5. 吴恩达深度学习第4课第3周编程作业 + PIL + Python3 + Anaconda环境 + Ubuntu + 导入PIL报错的解决

    问题描述: 做吴恩达深度学习第4课第3周编程作业时导入PIL包报错. 我的环境: 已经安装了Tensorflow GPU 版本 Python3 Anaconda 解决办法: 安装pillow模块,而不 ...

  6. 【DeepLearning学习笔记】Coursera课程《Neural Networks and Deep Learning》——Week2 Neural Networks Basics课堂笔记

    Coursera课程<Neural Networks and Deep Learning> deeplearning.ai Week2 Neural Networks Basics 2.1 ...

  7. 吴恩达深度学习 反向传播(Back Propagation)公式推导技巧

    由于之前看的深度学习的知识都比较零散,补一下吴老师的课程希望能对这块有一个比较完整的认识.课程分为5个部分(粗体部分为已经看过的): 神经网络和深度学习 改善深层神经网络:超参数调试.正则化以及优化 ...

  8. 深度学习 吴恩达深度学习课程2第三周 tensorflow实践 参数初始化的影响

    博主 撸的  该节 代码 地址 :https://github.com/LemonTree1994/machine-learning/blob/master/%E5%90%B4%E6%81%A9%E8 ...

  9. Coursera 吴恩达 深度学习 学习笔记

    神经网络和深度学习 Week 1-2 神经网络基础 Week 3 浅层神经网络 Week 4 深层神经网络 改善深层神经网络 Week 1 深度学习的实用层面 Week 2 优化算法 Week 3 超 ...

随机推荐

  1. OGRE的学习资源

    本文介绍从哪儿开始学习OGRE(Object-Oriented Graphics Rendering Engine的简称,又叫做OGRE 3D),如何在网上找寻OGRE的学习资源. 首先是wikipe ...

  2. mysql全量备份脚本

    #!/bin/bash# Program# use mysqldump to Fully backup mysql data per week!# History# PathBakDir=/data/ ...

  3. 【转】Entity Systems

    “Favour composition over inheritance” If you haven’t already read my previous post on the problems o ...

  4. C&num;操作xml SelectNodes&comma;SelectSingleNode总是返回NULL 与 xPath 介绍

    一. SelectNodes,SelectSingleNode总是返回NULL 下面以一个简单的xml为例: <?xml version="1.0"?> <mes ...

  5. CCapture directshow 视频捕获类

    // Capture.h for class CCapture #include <dshow.h> #include <qedit.h> #include <atlba ...

  6. 第一章 Android体系与系统架构

    1. Dalvik 和 ART(Android Runtime) 在Dalvik中应用好比是一辆可折叠的自行车,平时是折叠的,只有骑的时候,才需要组装起来用.在ART中应用好比是一辆组装好了的自行车, ...

  7. Django中下划线的用法介绍(一)

    在Django中有相当多的操作是通过双下划线与动作连接起来使用,为了以后更加方便的查找和使用,现在总结以下Django中基本的双下划线操作 比较符:大于--gt  小于--lt 等于--eq  大于等 ...

  8. 工作效率提升之Eclipse篇&lpar;1&rpar;:干掉烦人的xml文件的validation

    每次启动maven项目,都会有一堆烦人的xml文件的validation,一旦网络较慢,项目重新启动的时候,这些多余的验证纯属浪费时间. Eclipse上取消validation的方法: 1.菜单[W ...

  9. 检索系统向量化计算query-doc相似度

    def cal_sim2(A,B): ''' A :query [1,2] B: answers [[1,2],[3,5]] ''' need_norm=False A = np.array(A) B ...

  10. 加快Qemu Aarch32虚拟开发板的启动速度

    软件版本 Qemu: 2.8.0 虚拟开发板: vexpress-ca9 概述 之前的博文介绍了将Python移植到开发板上, 根文件系统采用的是ramdisk, 这个文件系统的缺点是修改的内容重启会 ...