2
$\begingroup$

While reading about 1D-convolution in PyTorch, I encountered the concept of channels

in_channels (int) – Number of channels in the input image

out_channels (int) – Number of channels produced by the convolution

Although I encountered this concept of channels early, I am confused about channels and might understand in a wrong manner.

Since the operation we are discussing is 1D convolution, then there will be two lists of numbers, one is input list and other is filter list. Last one is feature map (output list).

They look like below

1-D convolution

The left one is the input list, the middle one is the filter list and the rightmost is the output list.

Each cell in the input list contains a whole number. Each cell may take value in the fixed range $[a,b]$ of numbers.

What is the concept of channels used here? From where the channels are coming? Is the number of channels stand for the number of elements in the corresponding list?

$\endgroup$
1
0
$\begingroup$

Channels can be thought of as alternate numbers in the same space.

As an example, the three colour channels of a typical image are often values for amount of red, green or blue light received from each position within the picture.

Your 1D convolution example has one input channel and one output channel. Depending on what the input represents, you might have additional input channels representing other values measured in the same input space. For all but the most simple problems, you will have multiple output channels. The number of channels in each layer may vary, similarly to how the size of hidden layers in a fully connected neural network can vary.

The term "feature map" means the same as channel, and is typically used to describe the outputs of hidden layers.

To map from N input channels to M output channels requires $N \times M$ filters. Each of the M outputs is connected by a filter to each of the N inputs, and the results of running those N convolutions is summed and passed through a nonlinear activation function to generate an output channel.

Although in the abstract, a channel is a type of dimension, channels are considered as entirely separate to the space which is being processed. So adding channels to your 1D example does not make it a 2D convolutional neural network.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.