(f, f, n_C_prev, n_C) = W.shape
I defined the shape of W like above and used the code given like below
{moderator edit - solution code removed}
but my code still give me
ValueError: operands could not be broadcast together with shapes (2,0,3) (2,2,3) (2,0,3)
for the code
{moderator edit - solution code removed}
and i really can’f find what to correct… can anyone help me??
The code you show all looks correct, but the error must be in how the inputs there are defined. Why would the horizontal dimension end up being 0? Note that the test case here has pad = 2
and stride = 2
. Are you sure you handled the padding? And the stride
works the same way here that it does in conv_forward
and pool_forward
.
The way indexing works in python is that if you give a range (as in “start:end”), it doesn’t throw an error if the start value is off the end of the array. So the padding would be the first place to look.
I just made silly typo like below. haha thank you
horiz_end = horiz_start = f
It’s great news that you were able to solve it. Onward!