プリンキピア

第14章コンピュータビジョン

14.10. Transposed Convolution14.10 転置畳み込み

The CNN layers we have seen so far, such as convolutional layers (Section 7.2) and pooling layers (Section 7.5), typically reduce (downsample) the spatial dimensions (height and width) of the input, or keep them unchanged. In semantic segmentation that classifies at pixel-level, it will be convenient if the spatial dimensions of the input and output are the same. For example, the channel dimension at one output pixel can hold the classification results for the input pixel at the same spatial position.
英語のヒント
ここまでに見たCNNの層、たとえば畳み込み層(7.2節)やプーリング層(7.5節)は、ふつう入力の空間の次元(高さと幅)を減らす(ダウンサンプリングする)か、変えずに保つ。画素レベルで分類するセマンティックセグメンテーションでは、入力と出力の空間の次元が同じだと便利である。たとえば、ある出力画素でのチャネルの次元に、同じ空間の位置にある入力画素の分類結果を保持させられる。
To achieve this, especially after the spatial dimensions are reduced by CNN layers, we can use another type of CNN layers that can increase (upsample) the spatial dimensions of intermediate feature maps. In this section, we will introduce transposed convolution, which is also called fractionally-strided convolution (Dumoulin and Visin, 2016), for reversing downsampling operations by the convolution.
英語のヒント
これを達成するため、特にCNNの層で空間の次元が減った後で、途中の特徴マップの空間の次元を増やせる(アップサンプリングできる)別の種類のCNNの層を使える。この節では、畳み込みによるダウンサンプリングの操作を逆にするための、転置畳み込みを紹介する。それは分数ストライド畳み込み(Dumoulin and Visin, 2016)とも呼ばれる。
import torch
from torch import nn
from d2l import torch as d2l