Programming Assignment - Week 1- conv_forward

Hi, while trying to solve the ‘conv_forward’ function, I am receiving this error.
Somebody first clear me some points,

  1. what should be vert_end, horiz_end. The starting should be the loop variable multiplied by stride, what about the end
  2. What should be the dimensions of W and b? As I’ve read the queries on the forum, I understand that it should be 3, and if it should, then how do I extract the values?

After that, please also look at my code, the part shown in the error and give me some tips. Thanks

No-one except the course staff can directly examine your code. For the first question, the end values are the start values plus the size of the filter in that dimension, right? Of course the filters are f x f x nC_{in}.

Yes, it appears you are “slicing” the W value incorrectly. Note that the inner loop is over the output channels, right? So for each iteration, you pick the W and b “slice” that consists of all of the first 3 dimensions (as shown above) corresponding to the current value of the last dimension, which is output channels.

Here’s an earlier thread that has a nice explanation of all the logic for conv_forward.

Yes, Finally did it going through the thread and your help. Thank You