Fake images

We will use the following code to read fake images and then plot them:

# Fake image data
library(EBImage)
setwd("~/Desktop/FakeImages")
temp = list.files(pattern = "*.png")
mypic <- list()
for (i in 1:length(temp)) {mypic[[i]] <- readImage(temp[[i]])}
par(mfrow = c(10,10))
for (i in 1:length(temp)) plot(mypic[[i]])

In the preceding code, we have made use of the EBImage library to process fake image data. We have read all 100 images that are saved in the FakeImages directory. Now, we can plot all the images in a 10 x 10 grid, as shown in the following image:

In the preceding image, the first fake image from each of the 100 iterations is shown. From this, we can make the following observations:

  • The first ten images in the first row represent the first 10 iterations.
  • The first image simply reflects random noise. As we reach 10 iterations, the image begins to capture the essence of the handwritten digit five.
  • By the time the network training goes through iterations 91 to 100, digit five becomes visually more clear.

In the next section, we will carry out an experiment by making some changes in the network and observing its impact on the network's training process.

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

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