<p>Here's a simple explanation of what is going on in a special case that is used in <a href="https://arxiv.org/abs/1505.04597" rel="nofollow noreferrer"><code>U-Net</code></a> - that's one of the main use cases for transposed convolution. </p>

<p>We're interested in the following layer:</p>

<pre><code>Conv2DTranspose(64, (2, 2), strides=(2, 2))
</code></pre>

<p>What does this layer do <strong>exactly</strong>? Can we reproduce its work?</p>

<p>Here’s the <strong>answer</strong>:</p>

<ul>
<li>First of all the default padding in this case is valid. This means we have no padding.</li>
<li>The size of the output will be 2 times bigger: if input (m, n), output will be (2m, 2n). Why is that? See the next point.</li>
<li>Take the first element from the input and multiply by the filter weights with shape (2,2). Put it into the output. Take the next element, multiply and put in the output next to the first result without overlapping. Why is that? We have strides (2, 2).</li>
</ul>

<p>Here's an example input and output (see details <a href="https://medium.com/@ilyarudyak/transposed-convolution-3a4725872a9a?source=friends_link&amp;sk=ecd7a3f8568cb0ac327920c9676d788e" rel="nofollow noreferrer">here</a> and <a href="https://gist.github.com/ilyarudyak/8fdec3a6111226a5123fa0988dc36303" rel="nofollow noreferrer">here</a>):</p>

<pre><code>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)
</code></pre>

<p>This slide from Stanford's cs231n is useful for our question:</p>

<p><a href="https://i.stack.imgur.com/T5EyN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T5EyN.png" alt="enter image description here"></a></p>
What does TensorFlow's `conv2d_transpose()` operation do?
<p>The documentation for the <code>conv2d_transpose()</code> operation does not clearly explain what it does:</p>

<blockquote>
  <p>The transpose of conv2d.</p>
  
  <p>This operation is sometimes called "deconvolution" after
  <a href="http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf" rel="noreferrer">Deconvolutional Networks</a>, but is actually the transpose (gradient) of
  conv2d rather than an actual deconvolution.</p>
</blockquote>

<p>I went through the paper that the doc points to, but it did not help.</p>

<p>What does this operation do and what are examples of why you would want to use it?</p>