Week 3 exercise 6 cost function

week 3 and exercise6

{moderator edit - solution code removed}

I am having an error saying “ValueError: operands could not be broadcast together with shapes (4,3) (3,2)” when computing the dW1 and many errors in remaining lines too. but it is very same as given in the notebook by grader , can somebody pls help.

That is not the correct implementation for dZ1. the operation between W2^T and dZ2 is not np.multiply (which is elementwise): it is a dot product or np.dot.

Please see this thread for more information about the notational conventions that Prof Ng uses for the different types of multiplication.