【中英】【吴恩达课后测验】Course 5 - 序列模型 - 第一周测验
【中英】【吴恩达课后测验】Course 5 -序列模型 - 第一周测验 - 循环神经网络
上一篇:【课程4 - 第四周编程作业】※※※※※ 【回到目录】※※※※※下一篇:【待撰写-课程5 -第一周编程作业】
- 假设你的训练样本是句子(单词序列),下面哪个选项指的是第\(i\)个训练样本中的第\(j\)个词?
【★】 \(x^{(i)<j>}\)
【 】 \(x^{<i>(j)}\)
【 】 \(x^{(j)<i>}\)
【 】 \(x^{<j>(i)}\)
We index into the \(i^{th}\) row first to get the \(i^{th}\) training example (represented by parentheses), then the \(j^{th}\) column to get the \(j^{th}\) word (represented by the brackets).
首先获取第\(i\)个训练样本(用括号表示),然后到 \(j\)列获取单词(用括尖括号表示)。
- 看一下下面的这个循环神经网络:
在下面的条件中,满足上图中的网络结构的参数是:
【★】 \(T_x = T_y\)
【 】 \(T_x < T_y\)
【 】 \(T_x > T_y\)
【 】 \(T_x = 1\)
It is appropriate when every input should be matched to an output.
上图中每一个输入都与输出相匹配。
- 这些任务中的哪一个会使用多对一的RNN体系结构?
【 】 语音识别(输入语音,输出文本)。
【★】 情感分类(输入一段文字,输出0或1表示正面或者负面的情绪)。
【 】 图像分类(输入一张图片,输出对应的标签)。
【★】 人声性别识别(输入语音,输出说话人的性别)。
- 假设你现在正在训练下面这个RNN的语言模型:
在\(t\)时,这个RNN在做什么?
【 】 计算 \(P(y^{<1>}, y^{<2>}, …, y^{<t-1>})\)
【 】 计算 \(P(y^{<t>})\)
【★】 计算 \(P(y^{<t>} \mid y^{<1>}, y^{<2>}, …, y^{<t-1>})\)
【 】 计算 \(P(y^{<t>} \mid y^{<1>}, y^{<2>}, …, y^{<t>})\)
Yes,in a language model we try to predict the next step based on the knowledge of all prior steps.
是的,这个语言模型正在试着根据前面所有的知识来预测下一步。
- 你已经完成了一个语言模型RNN的训练,并用它来对句子进行随机取样,如下图:
在每个时间步\(t\)都在做什么?
【 】 (1)使用RNN输出的概率,选择该时间步的最高概率单词作为\(\hat{y}^{<t>}\),(2)然后将训练集中的正确的单词传递到下一个时间步。
【 】 (i)使用由RNN输出的概率将该时间步的所选单词进行随机采样作为 \(\hat{y}^{<t>}\),(2)然后将训练集中的实际单词传递到下一个时间步。
【 】 (1)使用由RNN输出的概率来选择该时间步的最高概率词作为 \(\hat{y}^{<t>}\),(2)然后将该选择的词传递给下一个时间步。
【★】 (1)使用RNN该时间步输出的概率对单词随机抽样的结果作为\(\hat{y}^{<t>}\),(2)然后将此选定单词传递给下一个时间步。
- 你正在训练一个RNN网络,你发现你的权重与激活值都是“NaN”,下列选项中,哪一个是导致这个问题的最有可能的原因?
【 】 梯度消失。
【★】 梯度爆炸。
【 】 ReLU函数作为激活函数g(.),在计算g(z)时,z的数值过大了。
【 】 Sigmoid函数作为激活函数g(.),在计算g(z)时,z的数值过大了。
- 假设你正在训练一个LSTM网络,你有一个10,000词的词汇表,并且使用一个激活值维度为100的LSTM块,在每一个时间步中,\(\Gamma_{u}\)的维度是多少?
【 】 1
【★】 100
【 】300
【 】 10000
Correct, \(\Gamma_u\) is a vector of dimension equal to the number of hidden units in the LSTM.
\(\Gamma_u\)的向量维度等于LSTM中隐藏单元的数量。
- 这里有一些GRU的更新方程:
爱丽丝建议通过移除 \(\Gamma_u\)来简化GRU,即设置\(\Gamma_u\)=1。贝蒂提出通过移除\(\Gamma_r\)来简化GRU,即设置\(\Gamma_r\)=1。哪种模型更容易在梯度不消失问题的情况下训练,即使在很长的输入序列上也可以进行训练?
【 】 爱丽丝的模型(即移除\(\Gamma_u\)),因为对于一个时间步而言,如果\(\Gamma_r \approx 0\),梯度可以通过时间步反向传播而不会衰减。
【 】 爱丽丝的模型(即移除\(\Gamma_u\)),因为对于一个时间步而言,如果\(\Gamma_r \approx 1\),梯度可以通过时间步反向传播而不会衰减。
【★】 贝蒂的模型(即移除\(\Gamma_r\)),因为对于一个时间步而言,如果\(\Gamma_u \approx 0\),梯度可以通过时间步反向传播而不会衰减。
【 】 贝蒂的模型(即移除\(\Gamma_r\)),因为对于一个时间步而言,如果\(\Gamma_u \approx 1\),梯度可以通过时间步反向传播而不会衰减。
For the signal to backpropagate without vanishing, we need \(c^{<t>}\) to be highly dependant on \(c^{<t-1>}\)
要使信号反向传播而不消失,我们需要 \(c^{<t>}\)高度依赖于\(c^{<t-1>}\)。
- 这里有一些GRU和LSTM的方程:
从这些我们可以看到,在LSTM中的更新门和遗忘门在GRU中扮演类似 \(\underline{\quad \quad}\)与\(\underline{\quad \quad}\)的角色,空白处应该填什么?
【★】 \(\Gamma_u\) 与 1−\(\Gamma_u\)
【 】 \(\Gamma_u\) 与 \(\Gamma_r\)
【 】 1−\(\Gamma_u\) 与 \(\Gamma_u\)
【 】 \(\Gamma_r\) 与 $ \Gamma_u$
- 你有一只宠物狗,它的心情很大程度上取决于当前和过去几天的天气。你已经收集了过去365天的天气数据\(x^{<1>}, …, x^{<365>}\),这些数据是一个序列,你还收集了你的狗心情的数据\(y^{<1>}, …, y^{<365>}\),你想建立一个模型来从x到y进行映射,你应该使用单向RNN还是双向RNN来解决这个问题?
【 】 双向RNN,因为在\(t\)日的情绪预测中可以考虑到更多的信息。
【 】 双向RNN,因为这允许反向传播计算中有更精确的梯度。
【★】 单向RNN,因为\(y^{<t>}\)的值仅依赖于\(x^{<1>}, …, x^{<t>}\),而不依赖于\(x^{<t+1>}, …, x^{<365>}\)。
【 】 单向RNN,因为\(y^{<t>}\)的值只取决于\(x^{<t>}\),而不是其他天的天气。
Recurrent Neural Networks
- Suppose your training examples are sentences (sequences of words). Which of the following refers to the jth word in the ith training example?
- \(x^{(i)<j>}\)
- \(x^{<i>(j)}\)
- \(x^{(j)<i>}\)
- \(x^{<j>(i)}\)
We index into the \(i^{th}\) row first to get the \(i^{th}\) training example (represented by parentheses), then the \(j^{th}\) column to get the \(j^{th}\) word (represented by the brackets).
- Consider this RNN:
This specific type of architecture is appropriate when:
- \(T_x = T_y\)
- \(T_x < T_y\)
- \(T_x > T_y\)
- \(T_x = 1\)
It is appropriate when every input should be matched to an output.
- To which of these tasks would you apply a many-to-one RNN architecture? (Check all that apply).
- peech recognition (input an audio clip and output a transcript)
- Sentiment classification (input a piece of text and output a 0/1 to denote positive or negative sentiment)
- Image classification (input an image and output a label)
- Gender recognition from speech (input an audio clip and output a label indicating the speaker’s gender)
- You are training this RNN language model.
At the \(t^{th}\) time step, what is the RNN doing? Choose the best answer.
- Estimating \(P(y^{<1>}, y^{<2>}, …, y^{<t-1>})\)
- Estimating \(P(y^{<t>})\)
- Estimating \(P(y^{<t>} \mid y^{<1>}, y^{<2>}, …, y^{<t-1>})\)
- Estimating \(P(y^{<t>} \mid y^{<1>}, y^{<2>}, …, y^{<t>})\)
Yes,in a language model we try to predict the next step based on the knowledge of all prior steps.
- You have finished training a language model RNN and are using it to sample random sentences, as follows:
What are you doing at each time step t?
- (i) Use the probabilities output by the RNN to pick the highest probability word for that time-step as \(\hat{y}^{<t>}\). (ii) Then pass the ground-truth word from the training set to the next time-step.
- (i) Use the probabilities output by the RNN to randomly sample a chosen word for that time-step as \(\hat{y}^{<t>}\). (ii) Then pass the ground-truth word from the training set to the next time-step.
- (i) Use the probabilities output by the RNN to pick the highest probability word for that time-step as \(\hat{y}^{<t>}\). (ii) Then pass this selected word to the next time-step.
- (i) Use the probabilities output by the RNN to randomly sample a chosen word for that time-step as \(\hat{y}^{<t>}\). (ii) Then pass this selected word to the next time-step.
- You are training an RNN, and find that your weights and activations are all taking on the value of NaN (“Not a Number”). Which of these is the most likely cause of this problem?
- Vanishing gradient problem.
- Exploding gradient problem.
- ReLU activation function g(.) used to compute g(z), where z is too large.
- Sigmoid activation function g(.) used to compute g(z), where z is too large.
- Suppose you are training a LSTM. You have a 10000 word vocabulary, and are using an LSTM with 100-dimensional activations a. What is the dimension of Γu at each time step?
- 1
- 100
- 300
- 10000
Correct, \(\Gamma_u\) is a vector of dimension equal to the number of hidden units in the LSTM.
- Here’re the update equations for the GRU.
Alice proposes to simplify the GRU by always removing the \(\Gamma_u\). I.e., setting \(\Gamma_u\) = 1. Betty proposes to simplify the GRU by removing the \(\Gamma_r\). I. e., setting \(\Gamma_r\) = 1 always. Which of these models is more likely to work without vanishing gradient problems even when trained on very long input sequences?
- Alice’s model (removing \(\Gamma_u\)), because if \(\Gamma_r\)≈0 for a timestep, the gradient can propagate back through that timestep without much decay.
- Alice’s model (removing \(\Gamma_u\)), because if \(\Gamma_r\)≈1 for a timestep, the gradient can propagate back through that timestep without much decay.
- Betty’s model (removing \(\Gamma_r\)), because if \(\Gamma_u\)≈0 for a timestep, the gradient can propagate back through that timestep without much decay.
- Betty’s model (removing \(\Gamma_r\)), because if \(\Gamma_u\)≈1 for a timestep, the gradient can propagate back through that timestep without much decay.
Yes, For the signal to backpropagate without vanishing, we need \(c^{<t>}\) to be highly dependant on \(c^{<t-1>}\)
- Here are the equations for the GRU and the LSTM:
From these, we can see that the Update Gate and Forget Gate in the LSTM play a role similar to _______ and ______ in the GRU. What should go in the the blanks?
- \(\Gamma_u\) and 1−\(\Gamma_u\)
- \(\Gamma_u\) and \(\Gamma_r\)
- 1−\(\Gamma_u\) and \(\Gamma_u\)
- \(\Gamma_r\) and \(\Gamma_u\)
- You have a pet dog whose mood is heavily dependent on the current and past few days’ weather. You’ve collected data for the past 365 days on the weather, which you represent as a sequence as \(x^{<1>}, …, x^{<365>}\). You’ve also collected data on your dog’s mood, which you represent as \(y^{<1>}, …, y^{<365>}\). You’d like to build a model to map from x→y. Should you use a Unidirectional RNN or Bidirectional RNN for this problem?
- Bidirectional RNN, because this allows the prediction of mood on day t to take into account more information.
- Bidirectional RNN, because this allows backpropagation to compute more accurate gradients.
- Unidirectional RNN, because the value of \(y^{<t>}\) depends only on \(x^{<1>}, …, x^{<t>}\), but not on \(x^{<t+1>}, …, x^{<365>}\)
- Unidirectional RNN, because the value of \(y^{<t>}\) depends only on \(x^{<t>}\), and not other days’ weather.
【中英】【吴恩达课后测验】Course 5 - 序列模型 - 第一周测验的更多相关文章
- 【吴恩达课后测验】Course 1 - 神经网络和深度学习 - 第二周测验【中英】
[中英][吴恩达课后测验]Course 1 - 神经网络和深度学习 - 第二周测验 第2周测验 - 神经网络基础 神经元节点计算什么? [ ]神经元节点先计算激活函数,再计算线性函数(z = Wx + ...
- 【吴恩达课后测验】Course 1 - 神经网络和深度学习 - 第一周测验【中英】
[吴恩达课后测验]Course 1 - 神经网络和深度学习 - 第一周测验[中英] 第一周测验 - 深度学习简介 和“AI是新电力”相类似的说法是什么? [ ]AI为我们的家庭和办公室的个人设备供电 ...
- 【中文】【deplearning.ai】【吴恩达课后作业目录】
[目录][吴恩达课后作业目录] 吴恩达深度学习相关资源下载地址(蓝奏云) 课程 周数 名称 类型 语言 地址 课程1 - 神经网络和深度学习 第1周 深度学习简介 测验 中英 传送门 无编程作业 编程 ...
- 吴恩达课后作业学习1-week4-homework-two-hidden-layer -1
参考:https://blog.csdn.net/u013733326/article/details/79767169 希望大家直接到上面的网址去查看代码,下面是本人的笔记 两层神经网络,和吴恩达课 ...
- 吴恩达课后作业学习1-week4-homework-multi-hidden-layer -2
参考:https://blog.csdn.net/u013733326/article/details/79767169 希望大家直接到上面的网址去查看代码,下面是本人的笔记 实现多层神经网络 1.准 ...
- 吴恩达课后作业学习2-week1-1 初始化
参考:https://blog.csdn.net/u013733326/article/details/79847918 希望大家直接到上面的网址去查看代码,下面是本人的笔记 初始化.正则化.梯度校验 ...
- 吴恩达课后作业学习2-week1-2正则化
参考:https://blog.csdn.net/u013733326/article/details/79847918 希望大家直接到上面的网址去查看代码,下面是本人的笔记 4.正则化 1)加载数据 ...
- 吴恩达深度学习第2课第2周编程作业 的坑(Optimization Methods)
我python2.7, 做吴恩达深度学习第2课第2周编程作业 Optimization Methods 时有2个坑: 第一坑 需将辅助文件 opt_utils.py 的 nitialize_param ...
- 吴恩达老师机器学习课程chapter05——评估模型
吴恩达老师机器学习课程chapter05--评估模型 本文是非计算机专业新手的自学笔记,高手勿喷. 本文仅作速查备忘之用,对应吴恩达(AndrewNg)老师的机器学期课程第十章.第十一章. 目录 吴恩 ...
- 吴恩达深度学习第4课第3周编程作业 + PIL + Python3 + Anaconda环境 + Ubuntu + 导入PIL报错的解决
问题描述: 做吴恩达深度学习第4课第3周编程作业时导入PIL包报错. 我的环境: 已经安装了Tensorflow GPU 版本 Python3 Anaconda 解决办法: 安装pillow模块,而不 ...
随机推荐
- Qt读取Oracle中的中文乱码问题
Qt读取oracle中的中文 因为有的时候我们的oracle数据库里面的值是一个varchar2格式的,这就是一个ascii码,但是我们qt一般不是ascii码 解决方法如下 先使用utl_raw.c ...
- minikube搭建Kubernetes环境
前言 Kubernetes 一般都运行在大规模的计算集群上,管理很严格,Kubernetes 充分考虑到了这方面的需求,提供了一些快速搭建 Kubernetes 环境的工具. minikube 它是一 ...
- go mod 安装使用 beego
go module基本使用 // 创建目录,初始化新项目 mkdir beemod cd beemod go mod init beemod 创建 server.go 文件 package main ...
- Ai满嘴顺口溜,想考研?浪费我几个小时
Trae + claude3.7 事情的经过是这样的: 我有个方法代码如下: /// <summary> /// 获取客户端列表 /// </summary> /// < ...
- 自定义异常--java进阶day08
1.自定义异常 2.自定义异常的格式 看你想要定义哪种异常,对应的继承哪种异常类 以我们之前写的代码举例,Exception类过于庞大,所有的异常子类都可以被它接收,这样就会导致无法精确捕获,所以我们 ...
- 我对TamperMonkey的不满-更新中
我认为我的电脑上的TamperMonkey插件的值得考虑的不足: 没有提供一个把脚本最小化的功能 不能编辑热键 脚本icon不能使用svg 没有提供一种很好的能够区分别人的脚本和自己的脚本的方式,自己 ...
- DevSecOps的实现与相关开源工具
DevSecOps的实现与相关开源工具 DevSecOps是一种以自动化方式在DevOps流程中集成安全工具的方法.DevSecOps不仅仅是引入新的安全工具,还包括关于使用这些工具的必要知识.这需要 ...
- ubuntu 22.04安装harbor
一.概述 Harbor 是一个企业级的云原生容器镜像仓库,由 VMware 开发并贡献给 Cloud Native Computing Foundation (CNCF).它在传统的 Docker R ...
- HTB打靶记录-TheFrizz
信息收集 nmap -sV -sC -O 10.10.11.60 Nmap scan report for 10.10.11.60 Host is up (0.63s latency). Not sh ...
- 一款 .NET 开源、免费、轻量级且非侵入性的防火墙软件
前言 在当今数字化时代,系统服务器网络安全已成为我们日常生活和工作中不可忽视的重要议题.随着网络威胁的日益复杂和多样化,选择一款高效.可靠且易于使用的防火墙软件显得尤为重要.今天大姚给大家分享一款 . ...