Week 1 Assignment 1 conv_forward (a small pitfall)

No, if you need that, it means your code is incorrect. Your shapes and the loop limits should match if you’ve written it correctly. There are a number of posts earlier on this thread which discuss the point. Here’s one that’s a good starting point. And here’s another thread that has a nice description of the way all the loops work in conv_forward.

One other thing to note is that it is a mistake to include the stride as a “step” in the loop limits. That is covered at least implicitly on both the threads that I linked above.

1 Like