Improving autoencoder robustness
A successful strategy we can use to improve the model's robustness is to introduce a noise in the encoding phase. We call a denoising autoencoder a stochastic version of an autoencoder; in a denoising autoencoder, the input is stochastically corrupted, but the uncorrupted version of the same input is used as the target for the decoding phase.
Intuitively, a denoising autoencoder does two things: first, it tries to encode the input, preserving the relevant information; and then, it seeks to nullify the effect of the corruption process applied to the same input. In the next section, we'll show an implementation of a denoising autoencoder.
Implementing a denoising autoencoder
The network architecture is very simple. A 784-pixel input image is stochastically corrupted and then dimensionally reduced by an encoding network layer. The image size is reduced from 784 to 256 pixels.
In the decoding phase, we prepare the network for output, returning the image...