January 2019
Intermediate to advanced
342 pages
9h 17m
English
The discriminator will be a classic binary classification convolutional neural network that can classify the generator images as fake and the actual SVHN dataset images as real.
The discriminator network can be coded as follows:
def discriminator(img_dim,alpha=0.2): model = Sequential() model.add( Conv2D(64, kernel_size=5,strides=2, padding='same', input_shape=img_dim) ) model.add(LeakyReLU(alpha)) model.add(Conv2D(128,kernel_size=5,strides=2,padding='same')) model.add(BatchNormalization()) model.add(LeakyReLU(alpha)) model.add(Conv2D(256,kernel_size=5,strides=2,padding='same')) model.add(BatchNormalization()) model.add(LeakyReLU(alpha)) model.add(Flatten()) model.add(Dense(1)) model.add(Activation('sigmoid')) return ...Read now
Unlock full access