Ok. I think I’ve implemented what you’re saying but it still isn’t working. My loops now look like:
for h in range(n_H)
vert_start = hstride
vert_end = hstride + f
It passes the first test case where the stride is 2, but for the second test case when the stride is 1 it for some reason I’m getting the following error. I don’t understand why all
I realized that when I wrote the line to use the padding function I put in a pad value of 1 instead of using the “pad” variable that is taken from the hparameters dictionary. I’m now failing one of the test cases and passing the other ones.
The problem now appears to be that the values for Z are ints when they should be floats. The cause for this could be in conv_single_step (did you cast b to a float before adding it to Z?), or it may result from casting a value to an int somewhere.
OK, I can replicate that error if I use dtype=np.int64 in the initialization of Z with zeros (Z=np.zeros(()). If that is the case with you, this should be removed so that Z can be a float.
That was it. I initialized Z as such: Z = np.full((m, n_H, n_W, n_C), 0) but I guess I needed to initialize it like: Z = np.full((m, n_H, n_W, n_C), float(0))
Thank you so much renoudbosch I really really appreciate all the help
It seems that is the key post for undertstanding the stride. I understood that when we move from 1 in the Output volume it is corresponding of a movement of stride in a input Volume . But i still do not understand how and where to to that in code.