W3_E4: AssertionError: for variable Z2

Hello Everyone,
I am trying implementing E4.

Intent: Implement → Z2 = W2 . A1 + b2

Implementation: Although I have implemented this earlier, I continue to get Assertion Error.
(Attached picture)

QUERY: I tried below options, but issue still persists.
Z2 = np.dot(W2,A1) + b2 # FAIL
# Z2 = np.dot(np.transpose(W2),A1) + b2 # FAIL. Value Error.
# Z2 = np.dot(W2,np.transpose(A1)) + b2 # FAIL. Value Error.
# Z2 = np.dot(A1,W2) + b2 # FAIL. Value Error.
# Z2 = np.dot(A1,np.transpose(W2)) + b2 # FAIL. Value Error.
# Z2 = np.dot(np.transpose(A1),W2) + b2 # FAIL. Value Error.

Please assist.
Sincerely,
A

Error Observed:

A2 = [[-0.86360952 -0.86388209 -0.86355916]]


AssertionError Traceback (most recent call last)
in
3 print("A2 = " + str(A2))
4
----> 5 forward_propagation_test(forward_propagation)

~/work/release/W3A1/public_tests.py in forward_propagation_test(target)
108 assert output[1][“Z2”].shape == expected_Z2.shape, f"Wrong shape for cache[‘Z2’]."
109
→ 110 assert np.allclose(output[0], expected_A2), “Wrong values for A2”
111 assert np.allclose(output[1][“Z1”], expected_Z1), “Wrong values for cache[‘Z1’]”
112 assert np.allclose(output[1][“A1”], expected_A1), “Wrong values for cache[‘A1’]”

AssertionError: Wrong values for A2

Expected output

A2 = [[0.21292656 0.21274673 0.21295976]]
All tests passed!

But your error says wrong values for A2. So, why you are focusing on Z2? You showed six different ways to implement Z2. Instead of trying one after another, use your intuition to find out which way is correct and then just make sure you use correct activation function for A2.

Good catch…my bad :slight_smile:
Thanks a lot.
Sincerely,
A