October 2018
Intermediate to advanced
472 pages
10h 57m
English
The discriminator is a simple CNN binary classifier that takes in the image generated by the generator and tries to classify the image as original or fake.
The first layer is a convolution 2D layer with 64 filters of a size of 3*3 with the activation as LeakyReLU and Dropout as the regularizer. The second and third layers are the same as the first layer except the second layer has 128 filters and the third layer has 256 filters. The final layer is a Dense layer with sigmoid activation since we are doing a binary classification:
def img_discriminator(input_shape): discriminator = Sequential() discriminator.add(Conv2D(64, (3, 3), strides=2, padding='same', input_shape=input_shape, activation = 'linear')) discriminator.add(LeakyReLU(0.2)) ...
Read now
Unlock full access