C1_W3_Assignment _Exercise_5_

Hello,
I am having an issue and reading every post on the forum on the subject helped me understand the issue a little bit better, but unable to solve it still. I understand that most issues are in forward_propagation function, but it passed both the within notebook test and the “submit assignment” test.

I am not quite certain what is the issue. I am basically unable to pass Exercise 5 after every other exercise passed with full marks. I understand that the issue is that the first operand has a mismatch of dimensions in the matrix multiplication, but I’ve reviewed, and printed the shapes to check that they match, etc., and nothing.

Here is the error:

Here are the shapes of the variables:
image

Thank you

Shouldnt in this matrix multiplication one of them be transposed i.e. W.T *X. Try that and see if it resolves your issue.

I tried that a while ago, because of my understanding and some previous experience, but once I do that, the test for forward propagation gives me this same error (which is weird because it does not detect it in the previous form). Here is the error once I transpose it (from the test forward propagation within the notebook).

image

Finally finishes it. I knew it was something trivial (mainly because I tried every type of reshaping and it did not work). Be wary of the order of inputs, particularly, n_x and n_y =P. Had to reset the whole thing and line for line I saw it.

Thank you all!

1 Like