Hello,
I am getting the following error shown below:
Z’s mean =
0.8729023340425552
Z[0,2,1] =
[-5.42280893 1.88549165 -4.09974126 -3.48941271 -5.34564475 3.56732833
1.77640635 -2.33586583]
cache_conv[0][1][2][3] =
[-1.1191154 1.9560789 -0.3264995 -1.34267579]
ValueError Traceback (most recent call last)
in
11 print(“cache_conv[0][1][2][3] =\n”, cache_conv[0][1][2][3])
12
—> 13 conv_forward_test(conv_forward)
~/work/release/W1A1/public_tests.py in conv_forward_test(target)
65 b = np.random.randn(1, 1, 1, 8)
66
—> 67 Z, cache_conv = target(A_prev, W, b, {“pad” : 3, “stride”: 1})
68 Z_shape = Z.shape
69 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)
82 weights = W[:,:,:,c]
83 biases = b[:,:,:,c]
—> 84 Z[i,h,w,c] = conv_single_step(a_slice_prev, weights, biases)
85
86 # YOUR CODE ENDS HERE
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.sum(s)
27 Z = Z+ float(b)
ValueError: operands could not be broadcast together with shapes (3,2,4) (3,3,4)
After further inspection, I believe my error is in my horizontal stride calculations, however I am just confused about how to index. I have tried the whole day trying to figure out the indexing the corners but I am getting no where. I was wondering if there are hints. I have looked in the discourse from past examples but I dont seem to find new information to help me with this. Thank you for the time and help