144
Convolutional Autoencoders
Whenever your inputs are images, it makes sense to use convolutional neural networks
(convnets or CNNs) as encoders and decoders. In practical settings, autoencoders
applied to images are always convolutional autoencoders because they simply perform
much better.
Let’s implement one. The encoder will consist in a stack of Conv2D and MaxPooling2D
layers (max pooling is being used for spatial down-sampling), while the decoder will
consist in a stack of Conv2D and UpSampling2D layers.
Figure
4-28
shows the basic code to import all necessary
packages in a Jupyter
notebook. Also note the versions of the various packages.
Figure 4-28. Importing packages in a Juypter notebook
Chapter 4 autoenCoders
145
You will use the mnist images data set for this purpose. Mnist contains images for the
digits 0 to 9 and is used for many different use cases. Figure
4-29
shows
the code to load
MNIST data.
Do'stlaringiz bilan baham: