Hello community,
I have just finished Course nr. 2 " Calculus for Machine Learning and Data Science".
C2_W3_Assignment is about creating a NN with two layers. There was something strange when implementing the function: forward_propagation(X, parameters)
I have calculated Z1 using the matrix multiplication formula: Z1 = W1 @ X + b1
However, the later unittests “w3_unittest.test_forward_propagation(forward_propagation)”
produced the following result:
Test case "change_weights_check". Wrong output of Z1 for X =
[[ 5.46584646 6.71120407 7.21301753 ... 1.77559174 3.52245562
7.86492998]
[ 2.91868287 10.31812597 7.79616824 ... 2.43434264 3.64044705
6.77517917]]
Test for i = 1, j = 1999.
Expected:
-0.03577862954823146
Got:
-0.03577862954823145
47 Tests passed
1 Tests failed
So how this is possible? To have 47 tests passed and one failed. When I submitted the assignment, I got 100/100 points.
Is this a bug or I really missed something in the implementation?
I can provide more info about the actual definition of the forward_propagation function, but I don’t want to break the rules and give possible solutions to the assignment.
I hope someone will be able to clarify this.
Thank you and I really enjoyed the course.
I see here that the difference between expected and got outputs is very very minimal, and since you passed the assignment with 100 score, I would say there might something with the internals of python variables accuracies. Maybe if you run this cell again the fail might go way!
I tried to run the cell a few times, but there was always one failed test. I knew from the fact that 47 succeeded that my implementation was OK. Since difference is really small I guess that tolerance within he test itself could be a little bigger. Failed test is probably due to round off error.
Yes, the test is not properly implemented. This is very small (negligible) difference between actual and expected value and it should go within tolerance to be considered an exact value.
Usually, if you have already started a session and it gets updated later on, the updated files will not automatically appear in you session - this happens to prevent any loss of progress.
If, after following these steps, the problem still persists, please let me know.
Hey guys, it doesn’t look like there is a problem in any unit test nor the grader, as I can get 100% of grading here.
Could you guys check if you the matrices W1 and W2 in exercise 3 are correctly defined? You should use np.random.randn and not np.random.rand or other function.
You can also send me your notebook privately so I can have a look at it.
I’m having the same problem as the others. It did pass my notebook with no deductions but I was stumped on the very same test failure for a while. I continued the rest of the assignment but I was struggling at this point until I saw everyone else was having the same problem with the grader.
I’m not sure what changed, but I tried the exercise again from scratch this morning, still had a failing unittest on Exercise 4, but this time the autograder didn’t have an issue with Exercise 7 as before and I received full marks.