the convolution forward function runs several iterations successfully before throwing a shape error. What am I doing wrong?
Attached is the notebook
{moderator edit - notebook removed}

Your problem is that you are applying the “stride” in the output space, not the input space. Note that the loops here are over every element of the output space: you must provide a value for every one. Then at each position, you use the stride to compute where that maps to in the input space. The way you have written it, you will be skipping positions in the output space and then will run off the end of the h and w dimensions, which is why the error is thrown.

I realize you are just starting out in the course, so perhaps you had not read about the Honor Code, but please realize that we are not supposed to publicly share code. When you have a problem, it’s fine to show outputs and to even show exception traces (which do reveal a bit of source code). Usually we can give you some help and hints based on that. In cases in which that’s too hard, the mentors can ask you to share your code by DM, so that it doesn’t get revealed to the world. I’ll edit your post to remove the ipynb file.


ok. Thanks for the heads up. I wasn’t aware that I could not post code publicly on the forums. I have resolved the issue.