# GRADED FUNCTION: initialize_parameters
def initialize_parameters(n_x, n_h, n_y):
# moderator edit: code removed
When I run the following test = my results don’t match. I think this may be due to the use of random. But just wanted to check if this is just me not understanding this correctly or there is a problem with the way I am initializing
Error
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)
<ipython-input-25-0eb4c3a6d62e> in <module>
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!
`