latest output:
Z’s mean =
0.13271959100960323
Z[0,2,1] =
[-2.17796037 8.07171329 -0.5772704 3.36286738 4.48113645 -2.89198428
10.99288867 3.03171932]
cache_conv[0][1][2][3] =
[-1.1191154 1.9560789 -0.3264995 -1.34267579]
First Test: Z’s mean is incorrect. Expected: 0.5511276474566768
Your output: 0.13271959100960323 . Make sure you include stride in your calculation
ValueError Traceback (most recent call last)
in
15
16 conv_forward_test_1(z_mean, z_0_2_1, cache_0_1_2_3)
—> 17 conv_forward_test_2(conv_forward)
~/work/release/W1A1/public_tests.py in conv_forward_test_2(target)
85 b = np.random.randn(1, 1, 1, 8)
86
—> 87 Z, cache_conv = target(A_prev, W, b, {“pad” : 3, “stride”: 1})
88 Z_shape = Z.shape
89 assert Z_shape[0] == A_prev.shape[0], f"m is wrong. Current: {Z_shape[0]}. Expected: {A_prev.shape[0]}"
in conv_forward(A_prev, W, b, hparameters)
81 W_sliced=W[:,:,:,c]
82 b_sliced=b[:,:,:,c]
—> 83 Z[i,h,w,c]=conv_single_step(a_prev_pad,W_sliced,b_sliced)
84 # YOUR CODE ENDS HERE
85
in conv_single_step(a_slice_prev, W, b)
23 # Z = None
24 # YOUR CODE STARTS HERE
—> 25 s=np.multiply(a_slice_prev,W)
26 Z=np.float64(np.sum(s)+b)
27
ValueError: operands could not be broadcast together with shapes (2,2,4) (3,3,4)