January 2019
Intermediate to advanced
316 pages
8h 16m
English
This merged input is then fed to a block with one convolutional layer and a dense layer for classification purposes:
x3 = Conv2D(64 * 8, kernel_size=1, padding="same", strides=1)(merged_input)x3 = BatchNormalization()(x3)x3 = LeakyReLU(alpha=0.2)(x3)x3 = Flatten()(x3)x3 = Dense(1)(x3)x3 = Activation('sigmoid')(x3)
x3 is the output of this discriminator network. This outputs a probability of whether the passed image is real or fake.
Finally, create a model:
stage2_dis = Model(inputs=[input_layer, input_layer2], outputs=[x3])
As you can see, this model takes two inputs and returns one output.
The complete code for the discriminator network is as follows:
def build_stage2_discriminator(): input_layer = Input(
Read now
Unlock full access