A decoder reconstructs an output from the latent representation produced by an encoder. In a convolutional autoencoder, it expands the compressed view back toward the original image. section 8.1.2 section 8.6
A convolutional decoder typically follows this sequence:
- Apply convolutional layers to transform the latent view. section 8.1.2
- Upsample after successive convolutions to reverse the spatial reduction caused by pooling. section 8.1.2
- Finish with a convolutional layer that produces one channel for grayscale images or three channels for color images. section 8.1.2
Keras convolutional decoder
A compact decoder applies 16, 32, and 64-filter convolutions, each followed by 2×2 UpSampling, then emits a single-channel image with a final 3×3 convolution. The complete autoencoder uses Adam optimization and mean squared error loss. 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 decoder definition, including convolution, UpSampling, and output-channel configuration. section 8.1.2




