Reconstructing images from training data

Now, we can reconstruct images from the training data using the model that we have obtained. To do this, we can use the following code:

# Reconstructing images - training
rc <- ae_model %>% keras::predict_on_batch(x = trainx)
par(mfrow = c(5,5), mar = rep(0, 4))
for (i in 1:25) plot(as.raster(rc[i,,,]))

In the preceding code, we're using predict_on_batch to reconstruct the images after feeding trainx, which contains images with black lines across them. All 25 reconstructed images can be seen here:

From the preceding plot, it can be seen that the autoencoder model has learned to remove the black lines from the input images. The pictures are somewhat blurred since the autoencoder model tries to output only the main features from the images and misses certain details.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset