Coursera 吴恩达 Machine Learning 课程 week 5 quiz

本文提供了一份关于Andrew Ng在Coursera上开设的机器学习课程的编程作业代码,包括神经网络训练、反向传播算法及参数更新的向量化实现等关键内容。代码已通过本地运行测试,适用于学习和参考。

完整编程作业代码 GitHub 地址:https://github.com/coco-1998-2/Andrew-NG-Machine-Learning-Coursera

100%本地运行通过,不要直接拷贝,debug有问题的时候参考下就好。若是感觉有用,别忘记Star哦~

 

1.Question 1

You are training a three layer neural network and would like to use backpropagation to compute the gradient of the cost function. In the backpropagation algorithm, one of the steps is to update

for every i, ji,j. Which of the following is a correct vectorization of this step?

Correct

This version is correct, as it takes the "outer product" of the two vectors \delta^{(3)}δ(3) and a^{(2)}a(2) which is a matrix such that the (i,j)(i,j)-th entry is \delta^{(3)}_i * (a^{(2)})_jδi(3)​∗(a(2))j​ as desired.

 

2.Question 2

Suppose 𝚃𝚑𝚎𝚝𝚊𝟷 is a 5x3 matrix, and 𝚃𝚑𝚎𝚝𝚊𝟸 is a 4x6 matrix. You set 𝚝𝚑𝚎𝚝𝚊𝚅𝚎𝚌=[𝚃𝚑𝚎𝚝𝚊𝟷(:);𝚃𝚑𝚎𝚝𝚊𝟸(:)]. Which of the following correctly recovers 𝚃𝚑𝚎𝚝𝚊𝟸?

𝚛𝚎𝚜𝚑𝚊𝚙𝚎(𝚝𝚑𝚎𝚝𝚊𝚅𝚎𝚌(𝟷𝟼:𝟹𝟿),𝟺,𝟼)

𝚛𝚎𝚜𝚑𝚊𝚙𝚎(𝚝𝚑𝚎𝚝𝚊𝚅𝚎𝚌(𝟷𝟻:𝟹𝟾),𝟺,𝟼)

𝚛𝚎𝚜𝚑𝚊𝚙𝚎(𝚝𝚑𝚎𝚝𝚊𝚅𝚎𝚌(𝟷𝟼:𝟸𝟺),𝟺,𝟼)

𝚛𝚎𝚜𝚑𝚊𝚙𝚎(𝚝𝚑𝚎𝚝𝚊𝚅𝚎𝚌(𝟷𝟻:𝟹𝟿),𝟺,𝟼)

𝚛𝚎𝚜𝚑𝚊𝚙𝚎(𝚝𝚑𝚎𝚝𝚊𝚅𝚎𝚌(𝟷𝟼:𝟹𝟿),𝟼,𝟺)

Incorrect

Since Octave indexing starts at 1, 𝚝𝚑𝚎𝚝𝚊𝚅𝚎𝚌(𝟷𝟻:𝟹𝟾) starts at the last element of 𝚃𝚑𝚎𝚝𝚊𝟷instead of the first element of 𝚃𝚑𝚎𝚝𝚊𝟸.

 

3.Question 3

4.Question 4

5.Question 5

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值