# DLS 1 Week 4 - Assignment1 - Ex 10

**URL:** <https://community.deeplearning.ai/t/dls-1-week-4-assignment1-ex-10/16975>\
**Category:** Neural Networks and Deep Learning\
**Tags:** coursera-platform\
**Created:** [June 24, 2021, 3:39pm UTC](https://community.deeplearning.ai/t/dls-1-week-4-assignment1-ex-10/16975 "2021-06-24T15:39:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wanzl](https://avatars.discourse-cdn.com/v4/letter/w/8c91f0/32.png) [@Wanzl](https://community.deeplearning.ai/u/Wanzl)\
**Post date:** [June 24, 2021, 3:39pm UTC](https://community.deeplearning.ai/t/dls-1-week-4-assignment1-ex-10/16975/1 "2021-06-24T15:39:37Z")

</div>

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

```auto
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.

```

```auto
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]]

```

---

<div class="post-metadata">

**Author:** ![Wanzl](https://avatars.discourse-cdn.com/v4/letter/w/8c91f0/32.png) [@Wanzl](https://community.deeplearning.ai/u/Wanzl)\
**Post date:** [June 24, 2021, 3:54pm UTC](https://community.deeplearning.ai/t/dls-1-week-4-assignment1-ex-10/16975/2 "2021-06-24T15:54:04Z")

</div>

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

Lookup link

> [@W4\_A1\_Ex-10\_Test fails in update parameters](https://community.deeplearning.ai/t/week-4-assignment-1-exercise-10/12642/8):
>
> 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.

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [June 25, 2021, 10:52pm UTC](https://community.deeplearning.ai/t/dls-1-week-4-assignment1-ex-10/16975/3 "2021-06-25T22:52:31Z")

</div>

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](https://community.deeplearning.ai/t/week-3-program-assignment-update-parameters/4016) that goes through why -= doesn’t work in Week 3 and it’s the same deal here.
