July 2019
Intermediate to advanced
512 pages
19h 39m
English
Now, let's define our encoder. Unlike vanilla autoencoders, where we use feedforward networks, here we use a convolutional network. Hence, our encoder comprises three convolutional layers, followed by a max pooling layer with relu activations.
Define the first convolutional layer, followed by a max pooling operation:
x = Conv2D(16, (3, 3), activation='relu', padding='same')(input_image)x = MaxPooling2D((2, 2), padding='same')(x)
Define the second convolutional and max pooling layer:
x = Conv2D(8, (3, 3), activation='relu', padding='same')(x)x = MaxPooling2D((2, 2), padding='same')(x)
Define the final convolutional and max pooling layer:
x = Conv2D(8, (3, 3), activation='relu', padding='same')(x)encoder = MaxPooling2D((2, ...
Read now
Unlock full access