Vanilla autoencoder

A vanilla autoencoder looks as follows:

As displayed in the preceding diagram, a Vanilla autoencoder reconstructs the input with a minimal number of hidden layers and hidden units in its network.

To understand how a vanilla autoencoder works, let's go through the following recipe, where we reconstruct MNIST images using a lower-dimensional encoded version of the original image (the code file is available as Auto_encoder.ipynb in GitHub):

  1. Import the relevant packages:
import tensorflow as tfimport kerasimport numpy as npfrom keras.datasets import mnistfrom keras.models import Sequentialfrom keras.layers import Densefrom ...

Get Neural Networks with Keras Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.