Problem in DLS C1-W3-Assignment

Hello friends.
Can any one help understand Exercise 3 - initialize_parameters?
I wrote this code:

{moderator edit - solution code removed}

but not all tests passed! I wrote this based on the explanation of the function that says:

params – python dictionary containing your parameters:
W1 – weight matrix of shape (n_h, n_x)
b1 – bias vector of shape (n_h, 1)
W2 – weight matrix of shape (n_y, n_h)
b2 – bias vector of shape (n_y, 1)

it gives me this error: “AssertionError: Wrong values for W2
please help Thanks.

Your code handles W2 differently than it handles W1, which is why it fails that test. It’s not the dimensions, it’s the actual values that are the problem.

Also please note that we aren’t supposed to share our solutions in a public way, so please don’t post the code. Normally we can help just by seeing the error output, although in this case the code made it pretty clear what the problem is. And no harm is really done, since I edited your post to hide the code now that we have an answer.

1 Like

Thank you very much. sorry about sharing the code