Week 1 - Programming Assignment 1 - Exercise 3

Greetings,

One of the tests in exercise 3 of this programming assignment fails. To the best of my understanding, the matrix dimensions are correct and consistent with the hidden layer dimensions. It also is my understanding that the He scaling is being applied appropriately.

image

I would share more specifics about the implementation, but I am being mindful of the forum rules and am refraining from posting code that could give away the solution to the problem.

That being said, is it possible to have course staff look at the code I have implemented and check if there is a mistake on my part or if it is a mistake from the autograder?

In the previous two exercises, I have applied the same line of reasoning to size the W and b matrices appropriately and have passed all the tests accordingly. Therefore, it is not intuitive why this approach of sizing the matrices would suddenly break down in Ex 3, where the only difference is the He scalar multiplication. I have come across this same sort of error in other course programming assignments, but unfortunately the autograder is unable to provide any meaningful feedback.

Thank you.

W1 = [[ 1.78862847  0.43650985]
 [ 0.09649747 -1.8634927 ]
 [-0.2773882  -0.35475898]
 [-0.08274148 -0.62700068]]
b1 = [[0.]
 [0.]
 [0.]
 [0.]]
W2 = [[-0.03098412 -0.33744411 -0.92904268  0.62552248]]
b2 = [[0.]]
 All tests passed.

The above are my results from running the test cell for that function. You can see that all my W values are different than yours, although the shapes of everything agree with yours. One clue is that all your values are positive and mine are both positive and negative. I’ll bet you used the wrong random function: rand is not the same thing as randn, right? That little “n” on the end there makes a big difference. :nerd_face:

Thank you so much @paulinpaloalto ! Sure enough, I did have a typo in how I was calling the random number generator. That took care of it. Thank you again!