def create_discriminator_loss(disc_real_output, disc_fake_output):
# I.e. did we correctly identify the input as real or not?
cross_entropy_real = tf.nn.sigmoid_cross_entropy_with_logits(labels = disc_real_output, logits = tf.ones_like(disc_real_output))
disc_real_loss = tf.reduce_mean(cross_entropy_real, name='disc_real_loss')
cross_entropy_fake = tf.nn.sigmoid_cross_entropy_with_logits(labels = disc_fake_output, logits = tf.zeros_like(disc_fake_output))
disc_fake_loss = tf.reduce_mean(cross_entropy_fake, name='disc_fake_loss')
return disc_real_loss, disc_fake_loss
评论列表
文章目录