<p>The <code>Upsampling2D</code> is not the inverse of <code>MaxPooling</code>.</p>
<p>In fact, the max-pooling operation is non-invertible, meaning that there is no &quot;opposite&quot; mathematical operation which can lead us back to the state before applying the max-pooling.</p>
<p>Zeiler and Fergus state in their paper <a href="https://arxiv.org/pdf/1311.2901.pdf" rel="nofollow noreferrer">&quot;Visualizing and Understanding Convolutional Networks&quot;</a>:</p>
<blockquote>
<p>In the convnet, the max pooling operation is non-invertible, however
we can obtain an approximate inverse by recording the locations of the
maxima within each pooling region in a set of switch variables.</p>
</blockquote>
<p>Indeed, an <code>Upsampling2D</code> layer with a kernel of 2x2 and a stride of 2 will double the size of the tensor, but that does not mean that <code>Upsampling2D</code> is the inverse of the <code>MaxPooling</code>.</p>
<p>For more information please read the article: <a href="https://arxiv.org/pdf/1311.2901.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1311.2901.pdf</a> and the TensorFlow documentation for it: <a href="https://www.tensorflow.org/api_docs/python/tf/keras/layers/UpSampling2D" rel="nofollow noreferrer">https://www.tensorflow.org/api_docs/python/tf/keras/layers/UpSampling2D</a></p>
How we can calculate the Convolution Layer size in up-sampling using U-Net? like (w-f+2*p)/s +1 for upsampling 8x8 to 16x16
<p>in deep learning U-net down sampling Formula is (w-k+2*p)/S +1 but here i have to calculate the up sampling formula suppose current layer size is 8x8x32 to next layer size 16X16x32 what will be the formula for this up-sampling calculation.</p>