tensorflow_privacy/privacy/estimators/v1/head.py [161:181]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      if regularization_losses:
        regularization_loss = tf.math.add_n(regularization_losses)
        regularized_training_loss = tf.math.add_n(
            [training_loss, regularization_loss])
      else:
        regularization_loss = None
        regularized_training_loss = training_loss

      if self._loss_reduction == tf.compat.v1.losses.Reduction.NONE:
        scalar_loss = tf.reduce_mean(regularized_training_loss)
      else:
        scalar_loss = regularized_training_loss

      # Eval.
      if mode == ModeKeys.EVAL:
        return model_fn._TPUEstimatorSpec(  # pylint: disable=protected-access
            mode=ModeKeys.EVAL,
            predictions=predictions,
            loss=scalar_loss,
            eval_metrics=_create_eval_metrics_tuple(
                self._eval_metric_ops, {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tensorflow_privacy/privacy/estimators/v1/head.py [351:370]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      if regularization_losses:
        regularization_loss = tf.math.add_n(regularization_losses)
        regularized_training_loss = tf.math.add_n(
            [training_loss, regularization_loss])
      else:
        regularization_loss = None
        regularized_training_loss = training_loss

      if self._loss_reduction == tf.compat.v1.losses.Reduction.NONE:
        scalar_loss = tf.reduce_mean(regularized_training_loss)
      else:
        scalar_loss = regularized_training_loss
      # Eval.
      if mode == ModeKeys.EVAL:
        return model_fn._TPUEstimatorSpec(  # pylint: disable=protected-access
            mode=ModeKeys.EVAL,
            predictions=predictions,
            loss=scalar_loss,
            eval_metrics=_create_eval_metrics_tuple(
                self._eval_metric_ops, {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



