Advanced Deep Learning with Keras

fourpersent2020
from fourpersent2020 More from this publisher
16.03.2021 Views

Chapter 3Figure 3.2.6: Digits generated as the 2-dim latent vector space is navigatedIn Figure 3.2.5, we'll be able to see that the latent codes for a specific digit areclustering on a region in space. For example, digit 0 is on the lower left quadrant,while digit 1 is on the upper right quadrant. Such clustering is mirrored in Figure3.2.6. In fact, the same figure shows the result of navigating or generating newdigits from the latent space as shown in the Figure 3.2.5.For example, starting from the center and varying the value of a 2-dim latent vectortowards the lower left quadrant, shows us that the digit changes from 2 to 0. Thisis expected since from Figure 3.2.5, we're able to see that the codes for the digit 2clusters are near the center, and as discussed digit 0 codes cluster in the lower leftquadrant. For Figure 3.2.6, we've only explored the regions between -4.0 and +4.0for each latent dimension.[ 83 ]

AutoencodersAs can be seen in Figure 3.2.5, the latent code distribution is not continuous andranges beyond ± 4.0 . Ideally, it should look like a circle where there are valid valueseverywhere. Because of this discontinuity, there are regions where if we decode thelatent vector, hardly recognizable digits will be produced.Denoising autoencoder (DAE)We're now going to build an autoencoder with a practical application. Firstly,let's paint a picture and imagine that the MNIST digits images were corrupted bynoise, thus making it harder for humans to read. We're able to build a DenoisingAutoencoder (DAE) to remove the noise from these images. Figure 3.3.1 shows usthree sets of MNIST digits. The top rows of each set (for example, MNIST digits 7, 2,1, 9, 0, 6, 3, 4, 9) are the original images. The middle rows show the inputs to DAE,which are the original images corrupted by noise. The last rows show the outputsof DAE:Figure 3.3.1: Original MNIST digits (top rows),corrupted original images (middle rows) and denoised images (last rows)Figure 3.3.2: The input to the denoising autoencoder is the corrupted image.The output is the clean or denoised image. The latent vector is assumed to be 16-dim.[ 84 ]

Chapter 3

Figure 3.2.6: Digits generated as the 2-dim latent vector space is navigated

In Figure 3.2.5, we'll be able to see that the latent codes for a specific digit are

clustering on a region in space. For example, digit 0 is on the lower left quadrant,

while digit 1 is on the upper right quadrant. Such clustering is mirrored in Figure

3.2.6. In fact, the same figure shows the result of navigating or generating new

digits from the latent space as shown in the Figure 3.2.5.

For example, starting from the center and varying the value of a 2-dim latent vector

towards the lower left quadrant, shows us that the digit changes from 2 to 0. This

is expected since from Figure 3.2.5, we're able to see that the codes for the digit 2

clusters are near the center, and as discussed digit 0 codes cluster in the lower left

quadrant. For Figure 3.2.6, we've only explored the regions between -4.0 and +4.0

for each latent dimension.

[ 83 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!