(d_real, d_fake, d_real_logits=None, d_fake_logits=None)
Returns the discriminator and generator loss for the least-squares loss.

  Args:
    d_real: prediction for real points, values in [0, 1], shape [batch_size, 1].
    d_fake: prediction for fake points, values in [0, 1], shape [batch_size, 1].
    d_real_logits: ignored.
    d_fake_logits: ignored.

  Returns:
    A tuple consisting of the discriminator loss, discriminator's loss on the
    real samples and fake samples, and the generator's loss.
Returns the discriminator and generator loss for the least-squares loss.
Returns the discriminator and generator loss for the least - squares loss .
def least_squares(d_real, d_fake, d_real_logits=None, d_fake_logits=None):
  """Returns the discriminator and generator loss for the least-squares loss.

  Args:
    d_real: prediction for real points, values in [0, 1], shape [batch_size, 1].
    d_fake: prediction for fake points, values in [0, 1], shape [batch_size, 1].
    d_real_logits: ignored.
    d_fake_logits: ignored.

  Returns:
    A tuple consisting of the discriminator loss, discriminator's loss on the
    real samples and fake samples, and the generator's loss.
  """
  with tf.name_scope("least_square_loss"):
    check_dimensions(d_real, d_fake, d_real_logits, d_fake_logits)
    d_loss_real = tf.reduce_mean(tf.square(d_real - 1.0))
    d_loss_fake = tf.reduce_mean(tf.square(d_fake))
    d_loss = 0.5 * (d_loss_real + d_loss_fake)
    g_loss = 0.5 * tf.reduce_mean(tf.square(d_fake - 1.0))
    return d_loss, d_loss_real, d_loss_fake, g_loss
def least_squares ( d_real , d_fake , d_real_logits = None , d_fake_logits = None ) : with tf . name_scope ( "least_square_loss" ) : check_dimensions ( d_real , d_fake , d_real_logits , d_fake_logits ) d_loss_real = tf . reduce_mean ( tf . square ( d_real - 1.0 ) ) d_loss_fake = tf . reduce_mean ( tf . square ( d_fake ) ) d_loss = 0.5 * ( d_loss_real + d_loss_fake ) g_loss = 0.5 * tf . reduce_mean ( tf . square ( d_fake - 1.0 ) ) return d_loss , d_loss_real , d_loss_fake , g_loss