An encoder transforms input data into a compressed latent representation. In a convolutional autoencoder, convolution and pooling progressively reduce an image before the decoder reconstructs it. section 8.1.2 section 8.6
Listing 8.1 EDL_8_1_AE.ipynb: The encoder
input_layer = Input(shape=(28, 28, 1)) #1 encoded_layer1 = layers.Conv2D(64, (3, 3), activation=’relu’, padding=’same’)(input_layer) #2 encoded_layer1 = layers.MaxPool2D( (2, 2), padding=’same’)(encoded_layer1) encoded_layer2 = layers.Conv2D(32, (3, 3), activation=’relu’, padding=’same’)(encoded_layer1) #2 encoded_layer2 = layers.MaxPool2D( (2, 2), padding='same')(encoded_layer2) encoded_layer3 = layers.Conv2D(16, (3, 3), activation='relu', padding='same')(encoded_layer2) #2 latent_view = layers.MaxPool2D( (2, 2), padding='same')(encoded_layer3) #3
The implementation stacks convolutional layers with 64, 32, and 16 filters, using MaxPool2D to produce the latent view from a 28×28×1 image. section 8.1.2
A practical encoder pipeline typically:
- Accepts an image-shaped input and applies convolutional feature extraction. section 8.1.2
- Uses pooling after convolution to aggregate features and create the bottleneck. section 8.1.2 section 8.6
- Can be represented as a genetic sequence whose encoder layers are mirrored by decoder UpSampling and convolution layers. section 8.2.1
- Can vary through optional BatchNormalization and Dropout layers when architectures are generated or evolved. section 8.2.1
Fashion-MNIST convolutional autoencoder
For a 28×28 grayscale image, three convolutional stages use 64, 32, and 16 filters, with pooling after each stage; the final pooled output is the latent view passed to the decoder. section 8.1.2




















