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

  Args:
    d_real_logits: logits for real points, shape [batch_size, 1].
    d_fake_logits: logits for fake points, shape [batch_size, 1].
    d_real: ignored.
    d_fake: 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 Wasserstein loss.
Returns the discriminator and generator loss for Wasserstein loss .
def wasserstein(d_real_logits, d_fake_logits, d_real=None, d_fake=None):
  """Returns the discriminator and generator loss for Wasserstein loss.

  Args:
    d_real_logits: logits for real points, shape [batch_size, 1].
    d_fake_logits: logits for fake points, shape [batch_size, 1].
    d_real: ignored.
    d_fake: 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("wasserstein_loss"):
    check_dimensions(d_real, d_fake, d_real_logits, d_fake_logits)
    d_loss_real = -tf.reduce_mean(d_real_logits)
    d_loss_fake = tf.reduce_mean(d_fake_logits)
    d_loss = d_loss_real + d_loss_fake
    g_loss = -d_loss_fake
    return d_loss, d_loss_real, d_loss_fake, g_loss
def wasserstein ( d_real_logits , d_fake_logits , d_real = None , d_fake = None ) : with tf . name_scope ( "wasserstein_loss" ) : check_dimensions ( d_real , d_fake , d_real_logits , d_fake_logits ) d_loss_real = - tf . reduce_mean ( d_real_logits ) d_loss_fake = tf . reduce_mean ( d_fake_logits ) d_loss = d_loss_real + d_loss_fake g_loss = - d_loss_fake return d_loss , d_loss_real , d_loss_fake , g_loss