Comparing shallow and deep models is part of the experimentation process that leads to finding the best models. In this comparison over MNIST images, we will be implementing the architecture shown in Figure 9.6 as the shallow model, while the deep model architecture is shown in Figure 9.7:
As you can appreciate, both models are substantially different when it comes to the number of layers involved in each one. The quality of the reconstruction will be different as a consequence:
These models will be trained using a small number of epochs for the shallow VAE and a much larger number of epochs for the deeper model.
The code to reproduce the shallow encoder can be easily inferred from the example used in the Cleveland Heart Disease dataset; however, the code for the deep VAE will be discussed in the sections that follow.
Shallow VAE
One...