liveBook · Manning

Encoder

As explained in Evolutionary Deep Learning: Genetic algorithms and neural networks

An encoder is a model component that transforms an input into a lower-dimensional or otherwise compressed representation.

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

How Evolutionary Deep Learning: Genetic algorithms and neural networks covers it

How deep it goes
Explains convolution, pooling, bottlenecks, and evolutionary layer encoding, but defers detailed training and latent-space analysis.
Examples
Uses Fashion-MNIST, a Keras convolutional autoencoder, and randomly generated genetic architectures inspected through model summaries.
What it assumes
Assumes familiarity with convolutional layers and notebooks while reviewing the encoder construction incrementally through executable code.
What you can do after
Build it from scratch as a Keras encoder, compile it within an autoencoder, or generate and inspect evolutionary architectures.
How it connects
Connects encoders to autoencoders, decoders, convolutional neural networks, latent representations, and neuroevolution.

Also explained in

Compare how 21 books explain encoder →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Evolutionary Deep Learning: Genetic algorithms and neural networks. The section links point to the parts of the book it draws on.