The discriminator network

We have already explored the architecture of the discriminator network in The architecture of the discriminator network section. Let's start by writing the layers for the discriminator network in the Keras framework and then create a Keras model, using the functional API of the Keras framework.

Perform the following steps to implement the discriminator network in Keras:

  1. Start by defining the hyperparameters required for the discriminator network:
leakyrelu_alpha = 0.2momentum = 0.8input_shape = (256, 256, 3)
  1. Next, create an input layer to feed input to the network, as follows:
input_layer = Input(shape=input_shape)
  1. Next, add a convolution block, as follows: Configuration:
    • Filters: 64
    • Kernel size: 3
    • Strides ...

Get Generative Adversarial Networks Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.