DLS 1 Week 4 - Assignment1 - Ex 10

Can someone point where the wrong with my code, it seems the output match but the grader pointed there a test failed.

W1 = [[-0.59562069 -0.09991781 -2.14584584  1.82662008]
 [-1.76569676 -0.80627147  0.51115557 -1.18258802]
 [-1.0535704  -0.86128581  0.68284052  2.20374577]]
b1 = [[-0.04659241]
 [-1.28888275]
 [ 0.53405496]]
W2 = [[-0.55569196  0.0354055   1.32964895]]
b2 = [[-0.84610769]]
Error: Wrong output for variable W1.
Error: Wrong output for variable b1.
Error: Wrong output for variable W2.
Error: Wrong output for variable b2.
 2  Tests passed
 1  Tests failed
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-177-e0da3f3aab9d> in <module>
      7 print ("b2 = "+ str(t_parameters["b2"]))
      8 
----> 9 update_parameters_test(update_parameters)

~/work/release/W4A1/public_tests.py in update_parameters_test(target)
    501     ]
    502     #print(target(*test_cases[2]["input"]))
--> 503     multiple_test(test_cases, target)
    504 
    505 

~/work/release/W4A1/test_utils.py in multiple_test(test_cases, target)
    140         print('\033[92m', success," Tests passed")
    141         print('\033[91m', len(test_cases) - success, " Tests failed")
--> 142         raise AssertionError("Not all tests were passed for {}. Check your equations and avoid using global variables inside the function.".format(target.__name__))
    143 

AssertionError: Not all tests were passed for update_parameters. Check your equations and avoid using global variables inside the function.


Expected output:

W1 = [[-0.59562069 -0.09991781 -2.14584584  1.82662008]
 [-1.76569676 -0.80627147  0.51115557 -1.18258802]
 [-1.0535704  -0.86128581  0.68284052  2.20374577]]
b1 = [[-0.04659241]
 [-1.28888275]
 [ 0.53405496]]
W2 = [[-0.55569196  0.0354055   1.32964895]]
b2 = [[-0.84610769]]
1 Like

The problem was solved looking from the other poster
The answer is the grader doesn’t accept “-=” operator

Lookup link

3 Likes

It’s great that you were able to use the previous posts on Discourse to find the answer under your own power! Thanks for confirming.

BTW here’s another local thread that goes through why -= doesn’t work in Week 3 and it’s the same deal here.