# Course 1 - Week 3 - Programming Assignment

**URL:** <https://community.deeplearning.ai/t/course-1-week-3-programming-assignment/187069>\
**Category:** Neural Networks and Deep Learning\
**Tags:** coursera-platform\
**Created:** [August 17, 2022, 3:23am UTC](https://community.deeplearning.ai/t/course-1-week-3-programming-assignment/187069 "2022-08-17T03:23:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan\_Olano](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/juan_olano/32/27125_2.png) [@Juan\_Olano](https://community.deeplearning.ai/u/Juan_Olano)\
**Post date:** [August 17, 2022, 3:23am UTC](https://community.deeplearning.ai/t/course-1-week-3-programming-assignment/187069/1 "2022-08-17T03:23:46Z")

</div>

Hi! For the life of mine, I have no idea why I am getting this error in the def initialize\_parameters. Error below.

The line that seems failing is the simplest one:

W1 = np.random.rand(n\_h, n\_x) \* 0.01

There is no way to get that wrong, and still the resulting values are rejected by the test.

I have done a ‘reload’ of the .py files already with the most current ones, so I assume that I am running the latest version of the assignment.

Any clue?

Thank you very much!

## W1 = [[0.00435995 0.00025926] [0.00549662 0.00435322] [0.00420368 0.00330335] [0.00204649 0.00619271]] b1 = [[0.] [0.] [0.] [0.]] W2 = [[0.00299655 0.00266827 0.00621134 0.00529142]] b2 = [[0.]]

AssertionError Traceback (most recent call last)  
 in   
8 print("b2 = " + str(parameters[“b2”]))  
9  
—\> 10 initialize\_parameters\_test(initialize\_parameters)

~/work/release/W3A1/public\_tests.py in initialize\_parameters\_test(target)  
57 assert parameters[“b2”].shape == expected\_output[“b2”].shape, f"Wrong shape for b2."  
58  
—\> 59 assert np.allclose(parameters[“W1”], expected\_output[“W1”]), “Wrong values for W1”  
60 assert np.allclose(parameters[“b1”], expected\_output[“b1”]), “Wrong values for b1”  
61 assert np.allclose(parameters[“W2”], expected\_output[“W2”]), “Wrong values for W2”

AssertionError: Wrong values for W1

Expected output

W1 = [[-0.00416758 -0.00056267]  
[-0.02136196 0.01640271]  
[-0.01793436 -0.00841747]  
[0.00502881 -0.01245288]]  
b1 = [[0.]  
[0.]  
[0.]  
[0.]]  
W2 = [[-0.01057952 -0.00909008 0.00551454 0.02292208]]  
b2 = [[0.]]  
All tests passed!

---

<div class="post-metadata">

**Author:** ![Mubsi](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mubsi/32/94983_2.png) [@Mubsi](https://community.deeplearning.ai/u/Mubsi)\
**Post date:** [August 17, 2022, 4:12pm UTC](https://community.deeplearning.ai/t/course-1-week-3-programming-assignment/187069/2 "2022-08-17T16:12:31Z")

</div>

Hi @Juan_Olano,

You are using the `rand` function. If you pay close attention to the `instructions`, you’ll see that it mentions to use the `randn`, this is a subtle, but a big, and might I add, an annoying, difference 😂

Best,  
Mubsi

---

<div class="post-metadata">

**Author:** ![Juan\_Olano](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/juan_olano/32/27125_2.png) [@Juan\_Olano](https://community.deeplearning.ai/u/Juan_Olano)\
**Post date:** [August 17, 2022, 4:27pm UTC](https://community.deeplearning.ai/t/course-1-week-3-programming-assignment/187069/3 "2022-08-17T16:27:26Z")

</div>

@Mubsi ah!!! Oh boy. Thanks a lot!
