def build_discriminator(self, image_size):
self.inputs_real = tf.placeholder(tf.float32, [None, *image_size],
name='inputs_real')
#-----------------------------------------------------------------------
# Process input so that it matches what the generator produces
#-----------------------------------------------------------------------
with tf.variable_scope('process_real'):
processed = self.inputs_real/128-1
#-----------------------------------------------------------------------
# Real discriminator
#-----------------------------------------------------------------------
ret = self.__discriminator(processed, 'discriminator', False)
self.dsc_real_out = ret[0]
self.dsc_real_logits = ret[1]
#-----------------------------------------------------------------------
# Fake discriminator
#-----------------------------------------------------------------------
ret = self.__discriminator(self.gen_out, 'discriminator', True)
self.dsc_fake_out = ret[0]
self.dsc_fake_logits = ret[1]
#---------------------------------------------------------------------------
评论列表
文章目录