W 3 A1 | Ex-6 | Difficulty with backward propagation

Hello, I would appreciate a pointer as to why I am getting an error here.

Lab ID: ygopedcd

I am doing something wrong with the vectorized implementation of Z1.

Many thanks,

Actually, I realized that there is a bug in that Z1 needs to be extracted from the cache dictionary too and not just A1 and A2.

If I do that, then I still do not get accurate values for dW1

AssertionError Traceback (most recent call last)
7 print ("db2 = "+ str(grads[“db2”]))
----> 9 backward_propagation_test(backward_propagation)

~/work/release/W3A1/public_tests.py in backward_propagation_test(target)
187 assert output[“db2”].shape == expected_output[“db2”].shape, f"Wrong shape for db2."
→ 189 assert np.allclose(output[“dW1”], expected_output[“dW1”]), “Wrong values for dW1”
190 assert np.allclose(output[“db1”], expected_output[“db1”]), “Wrong values for db1”
191 assert np.allclose(output[“dW2”], expected_output[“dW2”]), “Wrong values for dW2”

AssertionError: Wrong values for dW1

Hello, Nsaraf.

There’s a whole lot of formulas in this particular exercise. You need to be really very careful in their applications. Look out for dZ1 & dW1.

Besides, check the transpose part that you need to apply.

You are definitely missing something in your applications. If you don’t get it, then DM me your notebook and I will try looking at the given implementations.