The documentation for the conv2d_transpose() operation does not clearly explain what it does:
The transpose of conv2d.
This opera
Here's a simple explanation of what is going on in a special case that is used in U-Net - that's one of the main use cases for transposed convolution.
We're interested in the following layer:
Conv2DTranspose(64, (2, 2), strides=(2, 2))
What does this layer do exactly? Can we reproduce its work?
Here’s the answer:
Here's an example input and output (see details here and here):
In [15]: X.reshape(n, m)
Out[15]:
array([[ 0, 1, 2, 3, 4],
[ 5, 6, 7, 8, 9],
[10, 11, 12, 13, 14]])
In [16]: y_resh
Out[16]:
array([[ 0., 0., 1., 1., 2., 2., 3., 3., 4., 4.],
[ 0., 0., 1., 1., 2., 2., 3., 3., 4., 4.],
[ 5., 5., 6., 6., 7., 7., 8., 8., 9., 9.],
[ 5., 5., 6., 6., 7., 7., 8., 8., 9., 9.],
[10., 10., 11., 11., 12., 12., 13., 13., 14., 14.],
[10., 10., 11., 11., 12., 12., 13., 13., 14., 14.]], dtype=float32)
This slide from Stanford's cs231n is useful for our question: