parameters: (
      discriminator_real_classification_logits,
      discriminator_gen_classification_logits,
      one_hot_labels,
      label_smoothing=0.0,
      real_weights=1.0,
      generated_weights=1.0,
      scope=None,
      loss_collection=ops.GraphKeys.LOSSES,
      reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
      add_summaries=False)
return_statement: return loss
docstring: ACGAN loss for the discriminator.
  
    The ACGAN loss adds a classification loss to the conditional discriminator.
    Therefore, the discriminator must output a tuple consisting of
      (1) the real/fake prediction and
      (2) the logits for the classification (usually the last conv layer,
          flattened).
  
    For more details:
      ACGAN: https://arxiv.org/abs/1610.09585
  
    Args:
      discriminator_real_classification_logits: Classification logits for real
        data.
      discriminator_gen_classification_logits: Classification logits for generated
        data.
      one_hot_labels: A Tensor holding one-hot labels for the batch.
      label_smoothing: A float in [0, 1]. If greater than 0, smooth the labels for
        "discriminator on real data" as suggested in
        https://arxiv.org/pdf/1701.00160
      real_weights: Optional `Tensor` whose rank is either 0, or the same rank as
        `discriminator_real_outputs`, and must be broadcastable to
        `discriminator_real_outputs` (i.e., all dimensions must be either `1`, or
        the same as the corresponding dimension).
      generated_weights: Same as `real_weights`, but for
        `discriminator_gen_classification_logits`.
      scope: The scope for the operations performed in computing the loss.
      loss_collection: collection to which this loss will be added.
      reduction: A `tf.losses.Reduction` to apply to loss.
      add_summaries: Whether or not to add summaries for the loss.
  
    Returns:
      A loss Tensor. Shape depends on `reduction`.
  
    Raises:
      TypeError: If the discriminator does not output a tuple.
docstring_summary: ACGAN loss for the discriminator.
docstring_tokens: ACGAN loss for the discriminator .
function: def acgan_discriminator_loss(
      discriminator_real_classification_logits,
      discriminator_gen_classification_logits,
      one_hot_labels,
      label_smoothing=0.0,
      real_weights=1.0,
      generated_weights=1.0,
      scope=None,
      loss_collection=ops.GraphKeys.LOSSES,
      reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
      add_summaries=False):
    """ACGAN loss for the discriminator.
  
    The ACGAN loss adds a classification loss to the conditional discriminator.
    Therefore, the discriminator must output a tuple consisting of
      (1) the real/fake prediction and
      (2) the logits for the classification (usually the last conv layer,
          flattened).
  
    For more details:
      ACGAN: https://arxiv.org/abs/1610.09585
  
    Args:
      discriminator_real_classification_logits: Classification logits for real
        data.
      discriminator_gen_classification_logits: Classification logits for generated
        data.
      one_hot_labels: A Tensor holding one-hot labels for the batch.
      label_smoothing: A float in [0, 1]. If greater than 0, smooth the labels for
        "discriminator on real data" as suggested in
        https://arxiv.org/pdf/1701.00160
      real_weights: Optional `Tensor` whose rank is either 0, or the same rank as
        `discriminator_real_outputs`, and must be broadcastable to
        `discriminator_real_outputs` (i.e., all dimensions must be either `1`, or
        the same as the corresponding dimension).
      generated_weights: Same as `real_weights`, but for
        `discriminator_gen_classification_logits`.
      scope: The scope for the operations performed in computing the loss.
      loss_collection: collection to which this loss will be added.
      reduction: A `tf.losses.Reduction` to apply to loss.
      add_summaries: Whether or not to add summaries for the loss.
  
    Returns:
      A loss Tensor. Shape depends on `reduction`.
  
    Raises:
      TypeError: If the discriminator does not output a tuple.
    """
    with ops.name_scope(
        scope, 'acgan_discriminator_loss',
        (discriminator_real_classification_logits,
         discriminator_gen_classification_logits, one_hot_labels)) as scope:
      loss_on_generated = losses.softmax_cross_entropy(
          one_hot_labels, discriminator_gen_classification_logits,
          weights=generated_weights, scope=scope, loss_collection=None,
          reduction=reduction)
      loss_on_real = losses.softmax_cross_entropy(
          one_hot_labels, discriminator_real_classification_logits,
          weights=real_weights, label_smoothing=label_smoothing, scope=scope,
          loss_collection=None, reduction=reduction)
      loss = loss_on_generated + loss_on_real
      util.add_loss(loss, loss_collection)
  
      if add_summaries:
        summary.scalar('discriminator_gen_ac_loss', loss_on_generated)
        summary.scalar('discriminator_real_ac_loss', loss_on_real)
        summary.scalar('discriminator_ac_loss', loss)
  
    return loss
function_tokens: def acgan_discriminator_loss ( discriminator_real_classification_logits , discriminator_gen_classification_logits , one_hot_labels , label_smoothing = 0.0 , real_weights = 1.0 , generated_weights = 1.0 , scope = None , loss_collection = ops . GraphKeys . LOSSES , reduction = losses . Reduction . SUM_BY_NONZERO_WEIGHTS , add_summaries = False ) : with ops . name_scope ( scope , 'acgan_discriminator_loss' , ( discriminator_real_classification_logits , discriminator_gen_classification_logits , one_hot_labels ) ) as scope : loss_on_generated = losses . softmax_cross_entropy ( one_hot_labels , discriminator_gen_classification_logits , weights = generated_weights , scope = scope , loss_collection = None , reduction = reduction ) loss_on_real = losses . softmax_cross_entropy ( one_hot_labels , discriminator_real_classification_logits , weights = real_weights , label_smoothing = label_smoothing , scope = scope , loss_collection = None , reduction = reduction ) loss = loss_on_generated + loss_on_real util . add_loss ( loss , loss_collection ) if add_summaries : summary . scalar ( 'discriminator_gen_ac_loss' , loss_on_generated ) summary . scalar ( 'discriminator_real_ac_loss' , loss_on_real ) summary . scalar ( 'discriminator_ac_loss' , loss ) return loss