プリンキピア

第7章畳み込みニューラルネットワーク

7.4. Multiple Input and Multiple Output Channels7.4 複数の入力チャネルと複数の出力チャネル

While we described the multiple channels that comprise each image (e.g., color images have the standard RGB channels to indicate the amount of red, green and blue) and convolutional layers for multiple channels in Section 7.1.4, until now, we simplified all of our numerical examples by working with just a single input and a single output channel. This allowed us to think of our inputs, convolution kernels, and outputs each as two-dimensional tensors.
英語のヒント
7.1.4節では、各画像を構成する複数のチャネル(たとえば、カラー画像には赤、緑、青の量を示す標準的なRGBのチャネルがある)と、複数のチャネルのための畳み込み層を説明したが、これまでは、入力のチャネルも出力のチャネルも一つだけで扱って、すべての数値例を簡単にしてきた。これにより、入力、畳み込みカーネル、出力をそれぞれ2次元のテンソルとして考えられた。
When we add channels into the mix, our inputs and hidden representations both become three-dimensional tensors. For example, each RGB input image has shape 3×h×w. We refer to this axis, with a size of 3, as the channel dimension. The notion of channels is as old as CNNs themselves: for instance LeNet-5 (LeCun et al., 1995) uses them. In this section, we will take a deeper look at convolution kernels with multiple input and multiple output channels.
英語のヒント
チャネルを加えると、入力も隠れ表現も3次元のテンソルになる。たとえば、RGBの各入力画像の形状は3×h×wである。大きさが3のこの軸を、チャネルの次元と呼ぶ。チャネルという概念は、CNNそのものと同じくらい古い。たとえば、LeNet-5(LeCun et al., 1995)はチャネルを使っている。この節では、複数の入力チャネルと複数の出力チャネルをもつ畳み込みカーネルを、もっと深く見ていく。
import torch
from d2l import torch as d2l