Channels vs filters

A topic that I found a bit confusing was the distinction between channels vs number of filters that can be used to create stackable convolution outputs. In the lecture, Andrew used notation Nc and Nc’ to distinguish between channels and # of filters. However, this took me a but to understand the difference especially when you consider that channels are convoluted together from the previous layer whereas each filter is used independently to create stacked dimensions.

Where I got really stuck was in the 1st assignment for Week 1, for conv_forward function where it says “loop over channels (= #filters) of the output volume” -I found this is misleading as there is a distinction between channels and # of stacked filters. The iteration is over one of these, while the other is used in the convolution step. So I felt there was a bit of a disconnect between lecture and this assignment in clarifying that we are dealing with 4 dimensions and not 3 as the lecture suggests- and that we hold one dimension constant while fully convoluting over the other.

Figured I’d post in case people were running into similar confusion.

Hi, Steve.

Yes, there is a clear distinction between “input” channels and “output” channels. The early examples Prof Ng shows of how convolution filters work ignore the “channel” part of the process, so maybe that leaves the student to infer some things that should have been more explicit. But when you get to the conv_forward part of the Week 1 Step by Step exercise, things become more clear. You see that the filter array W has 4 dimensions: (f, f, nC_prev, n_C). So the way to think about this is that for every output channel (n_C), there is an input filter that has the shape f x f x nC_prev. In other words, the individual filters match the shape of the input and there is one of them for every output channel that you want to create. Note that the number of output channels at each layer of the ConvNet is a “hyperparameter”, meaning that you as the system designer just need to choose it.

1 Like