The documentation for the conv2d_transpose()
operation does not clearly explain what it does:
The transpose of conv2d.
This opera
Any linear transform, including convolution, can be represented as a matrix. A transpose convolution can be interpreted as transposing the convolution matrix before applying it. For example, consider the simple 1D convolution with kernel size of 3 and stride of 2.
If we transpose the convolution matrix and apply it to a 3 element vector we get the transpose convolution operation
Now at first, this doesn't look like a convolution operation anymore. But if we insert some zeros into the y vector first we can rewrite this equivalently as
This example demonstrates that the transpose of a strided convolution operator is equivalent to upsampling by a factor of the stride by inserting zeros, then adding some additional padding, and finally performing an unstrided (i.e. stride=1) convolution.
For higher dimensional transpose convolutions, the same upsampling-by-inserting-zeros method is applied to each dimensions before performing an unstrided convolution.