My output from this programming exercise is accurate and agrees exactly with the expected output. I believe that my shapes are correct–have gone over them multiple times. I have not included my code snippet, as required by Coursera. I continue to get the error code, “AssertionError: Wrong values for dW1” but all 6 values are the same as the expected outcome. Would appreciate any advice re this. I realize that my initialization of W1 Here is my output.
Shapes:
m 3
X: (2, 3)
Y: (1, 3)
b1 [[0.]
[0.]
[0.]
[0.]]
b2 [[0.]]
W1: (4, 2)
W2: (1, 4)
A1: (4, 3)
A2: (1, 3)
dZ1: (4, 3)
dW1: (4, 2)
db1: (4, 1)
dZ2: (1, 3)
dW2: (1, 4)
db2: (1, 1)
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]]
Please post a screen capture image that shows the entire error message including the assertion.
This will shed some light on which test is failing.
Note that the failing test may not be one that does not output any data to the console.
Thank you for responding. Here is a screen shot of the entire error message including the assertation.
AssertionError Traceback (most recent call last)
<ipython-input-140-a06d396e2b09> in <module>
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
Your code is not returning the correct value for dw1, when using the test provided in the backward_propagation_test() function in public_tests.py.
You can read this test by opening the public_tests.py file, from the File → Open menu. This will let you see what conditions your code does not work with correctly.
Thanks for the help! much appreciated!