I am stuck in this homework. I get this error:
ValueError Traceback (most recent call last)
in
6 “stride”: 2}
7
----> 8 Z, cache_conv = conv_forward(A_prev, W, b, hparameters)
9 print(“Z’s mean =\n”, np.mean(Z))
10 print(“Z[0,2,1] =\n”, Z[0, 2, 1])
in conv_forward(A_prev, W, b, hparameters)
97 weights = W[:, :, :, c]
98 biases = b[:,:,:, c]
—> 99 Z[i, h, w, c] = conv_single_step(a_slice_prev, weights, biases)
100
101
in conv_single_step(a_slice_prev, W, b)
23 # Z = None
24 # YOUR CODE STARTS HERE
—> 25 s = a_slice_prev * W
26 # Sum over all entries of the volume s.
27 Z = np.sum(s) + np.float(b)
ValueError: operands could not be broadcast together with shapes (2,3,9,4) (3,3,4)
This is my code, can somebody help me?
def conv_forward(A_prev, W, b, hparameters):
# YOUR CODE STARTS HERE
{mentor edit: code removed - not allowed by the Honor Code
# YOUR CODE ENDS HERE
# Save information in "cache" for the backprop
cache = (A_prev, W, b, hparameters)
return Z, cache