Exercise 6. Backward Propagation
Following errors are thrown eventhough the output values match with the expected values.
dW1 = [[ 0.00301023 -0.00747267]
[ 0.00257968 -0.00641288]
[-0.00156892 0.003893 ]
[-0.00652037 0.01618243]]
db1 = [[ 0.00176201]
[ 0.00150995]
[-0.00091736]
[-0.00381422]]
dW2 = [[ 0.00078841 0.01765429 -0.00084166 -0.01022527]]
db2 = [[-0.16655712]]
AssertionError Traceback (most recent call last)
in
7 print ("db2 = "+ str(grads[“db2”]))
8
----> 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."
188
→ 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
Expected output
dW1 = [[ 0.00301023 -0.00747267]
[ 0.00257968 -0.00641288]
[-0.00156892 0.003893 ]
[-0.00652037 0.01618243]]
db1 = [[ 0.00176201]
[ 0.00150995]
[-0.00091736]
[-0.00381422]]
dW2 = [[ 0.00078841 0.01765429 -0.00084166 -0.01022527]]
db2 = [[-0.16655712]]
All tests passed!