Upsampling increases the spatial resolution of a feature representation. In a convolutional autoencoder, it reverses the encoder’s pooling-driven reduction so the decoder can rebuild a full image. section 8.1.2
A decoder typically uses upsampling in a repeated convolutional sequence:
- Apply a convolution to the latent or intermediate representation. section 8.1.2
- Apply UpSampling2D((2, 2)) to double the spatial dimensions. section 8.1.2
- Repeat the convolution-and-upsampling pattern until the original resolution is restored, then use a final convolution to produce the output channels. section 8.1.2
Autoencoder decoder
A 28×28 grayscale autoencoder can decode its latent view with Conv2D layers of 16, 32, and 64 filters, each followed by UpSampling2D((2, 2)), then produce one output channel with a final Conv2D layer. section 8.1.2
Listing 8.2 EDL_8_1_AE.ipynb: The decoder
decoded_layer1 = layers.Conv2D(16, (3, 3), activation='relu', padding='same')(latent_view) #1 decoded_layer1 = layers.UpSampling2D((2, 2)) (decoded_layer1) #2 decoded_layer2 = layers.Conv2D(32, (3, 3), activation='relu', padding='same')(decoded_layer1) #1 decoded_layer2 = layers.UpSampling2D((2, 2)) (decoded_layer2) #2 decoded_layer3 = layers.Conv2D(64, (3, 3), activation='relu')(decoded_layer2) #1 decoded_layer3 = layers.UpSampling2D((2, 2)) (decoded_layer3) #2 output_layer = layers.Conv2D(1, (3, 3), padding='same')(decoded_layer3) #3
Inspect the executable Keras decoder pattern, including convolution, UpSampling2D, and final output-layer construction. section 8.1.2



