Architecture

The code that's used for developing the discriminator network architecture is as follows:

# Discriminator network
di <- layer_input(shape = c(h, w, c))
do <- di %>%
layer_conv_2d(filters = 64, kernel_size = 4) %>%
layer_activation_leaky_relu() %>%
layer_flatten() %>%
layer_dropout(rate = 0.3) %>%
layer_dense(units = 1, activation = "sigmoid")
d <- keras_model(di, do)

From the preceding code, we can observe the following:

  • We provided an input shape (di) with h = 28, w = 28, and c = 1. This is the dimension of fake and real images that will be used at the time of training the network.
  • In the last layer of the discriminator output (do), we have specified the activation function as sigmoid and the units as 1, since an image is differentiated as either real or fake.
  • di and do are used for the discriminator network model (d).
..................Content has been hidden....................

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