February 2018
Intermediate to advanced
450 pages
11h 27m
English
Next up, we need to implement the discriminator part of the network, which will be used to judge whether the incoming input is coming from the real dataset or generated by the generator. Again, we'll use the TensorFlow feature of tf.variable_scope to prefix some variables with discriminator so that we can retrieve and reuse them.
So, let's define the function which will return the binary output of the discriminator as well as the logit values:
# Defining the discriminator functiondef discriminator(input_imgs, reuse=False): # using variable_scope to reuse variables with tf.variable_scope('discriminator', reuse=reuse): # leaky relu parameter leaky_param_alpha = 0.2 # defining the layers conv_layer_1 = tf.layers.conv2d(input_imgs, ...
Read now
Unlock full access