W4_A1_Ex-10_Test fails in update parameters

Final test, Exercise 10. My code gives the expected output but fails 1 or the tests in update_parameters_test(update_parameters) (see screenshot below). The stack trace is not useful and I can’t find the actual contents of the test, which would be helpful for debugging. Advice?

1 Like

Hello @michael.brent
Yes, the expected output is the same but there are multiple test cases and your code should pass all the cases. Please recheck your implementation. And if the error continues then you can post your implementation so that we can figure out the issue.

1 Like

I’m having the same error. Have you found the solution yet?

Am I allowed to post my solution here? I have run out of ideas and since the failed test is not exposed to me I have very little information with which to debug. I have been stuck at the same point for months now, because (1) the cloud server was not working when I tried to submit (2) the assignment was changed under me (3) I reset deadlines without knowing that that would delete my previous version, which worked and gave the expected outputs (although I don’t think these new tests were in it). In any case, I am feeling like I wasted hundreds of dollars and super frustrated. I really just want to get on to the next course and would appreciate your help.

You are not allowed to post your codes, nor we to give you the solution.

However, look again at how you should initialize b1 and b2.

All initializations follow the instructions, give the expected outputs (including on Exercise 10), and pass all tests. The only the thing that isn’t passing is one of 3 hidden tests. Please advise.

Also, I was confused by rajat’s post earlier in this chain suggesting that I post my code. Isn’t he part of the course staff?

Of course rajat’s word is golden, and I must admit that it’s hard to help with just that output.

Here is the code for the last function followed by the output. If there is some other format you would like me to provide the code in, please let me know. Also note that if I knew what the test was that it is failing I might be better able to debut.

Ok, you can remove your code now.
I don’t really understand why right now, but the notebook doesn’t accept “-=” in the code. Rewrite the same thing differently and it should work.


Hello @michael.brent
I asked you to post your implementation because there is an error in the implemented code. And according to Deep Learning Honor Code, you should not post your solutions but because of some error that implementation is not the right solution. So, you are not sharing the solution but the problem.

Thank You :innocent:

Thanks for that clarification @rajat . OK, thanks for pointing out that -= is not working. Changing it did fix the problem. However, I believe I wasted weeks and weeks and much frustration because of Python not working according to the Python specification. How can this type of situation be avoided in the future?

1 Like

Hello @michael.brent

Please refer to these two discussions on StackOverflow.

A snap from first discussion-

I hope this clears your doubt.
All the best

this interesting issue, i have used this notation before without issues (july 2022). this is the first time this code fails. good to know.

This is a very useful thread. I was scratching my head for a while and I’m glad I thought to check the discussions.

If the test code is not going to be fixed then I suggest adding a comment in the assignment’s notebook in exercise 10 to give people a heads up not to use the “-=” operator. I did use “-=” on all previous assignments without issues.