完整编程作业代码 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

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

被折叠的 条评论
为什么被折叠?



