liveBook · Manning

Channel

As explained in Deep Learning with PyTorch, Second Edition

The tensor axis reserved for channel information.

A channel is a tensor axis reserved for one kind of information. In an RGB image, the red, green, and blue channels record separate intensity maps; a white area is bright in all three. section 4.1.1

Channels can represent input features as well as color. A convolution receives input channels and produces output channels, with each output channel able to detect a different kind of feature. section 8.2

RGB channels in a convolution

For a CIFAR-10 image, nn.Conv2d(3, 16, kernel_size=3) accepts three input channels and produces sixteen output channels. Its weight shape is [16, 3, 3, 3], and an input shaped [1, 3, 32, 32] produces output shaped [1, 16, 30, 30]. section 8.2

# In[7]:
conv = nn.Conv2d(3, 16, kernel_size=3)     #1
conv

# Out[7]:
Conv2d(3, 16, kernel_size=(3, 3), stride=(1, 1))

Inspect the PyTorch convolution declaration that specifies input channels, output channels, and kernel size. section 8.2

How Deep Learning with PyTorch, Second Edition covers it

How deep it goes
Defines channels through RGB intensity maps and demonstrates their convolutional tensor shapes, without developing channel-order conventions broadly.
Examples
Uses a rainbow split into RGB intensity maps and a CIFAR-10 Conv2d example with concrete input, weight, and output shapes.
What it assumes
Assumes familiarity with multidimensional tensors and image data while introducing channels through RGB examples.
What you can do after
Apply it via PyTorch by configuring convolutional input and output channels and checking resulting tensor shapes.
How it connects
Connects channels with tensors, RGB images, convolution, kernels, input features, and output features.

Also explained in

Compare how 7 books explain channel →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with PyTorch, Second Edition. The section links point to the parts of the book it draws on.