Home | History | Annotate | Download | only in python

Lines Matching refs:losses

15 """Losses that are useful for training GANs.
17 The losses belong to two main groups, but there are others that do not:
28 All losses must be able to accept 1D or 2D Tensors, so as to be compatible with
29 patchGAN style losses (https://arxiv.org/abs/1611.07004).
31 To make these losses usable in the TFGAN framework, please create a tuple
32 version of the losses with `losses_utils.py`.
51 from tensorflow.python.ops.losses import losses
52 from tensorflow.python.ops.losses import util
74 # Wasserstein losses from `Wasserstein GAN` (https://arxiv.org/abs/1701.07875).
79 loss_collection=ops.GraphKeys.LOSSES,
80 reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
95 reduction: A `tf.losses.Reduction` to apply to loss.
106 loss = losses.compute_weighted_loss(
121 loss_collection=ops.GraphKeys.LOSSES,
122 reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
140 reduction: A `tf.losses.Reduction` to apply to loss.
154 loss_on_generated = losses.compute_weighted_loss(
157 loss_on_real = losses.compute_weighted_loss(
171 # ACGAN losses from `Conditional Image Synthesis With Auxiliary Classifier GANs`
181 loss_collection=ops.GraphKeys.LOSSES,
182 reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
212 reduction: A `tf.losses.Reduction` to apply to loss.
225 loss_on_generated = losses.softmax_cross_entropy(
229 loss_on_real = losses.softmax_cross_entropy(
249 loss_collection=ops.GraphKeys.LOSSES,
250 reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
273 reduction: A `tf.losses.Reduction` to apply to loss.
286 loss = losses.softmax_cross_entropy(
297 # Wasserstein Gradient Penalty losses from `Improved Training of Wasserstein
311 loss_collection=ops.GraphKeys.LOSSES,
312 reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
336 reduction: A `tf.losses.Reduction` to apply to loss.
381 penalty = losses.compute_weighted_loss(
391 # Original losses from `Generative Adversarial Nets`
402 loss_collection=ops.GraphKeys.LOSSES,
403 reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
430 reduction: A `tf.losses.Reduction` to apply to loss.
441 loss_on_real = losses.sigmoid_cross_entropy(
446 loss_on_generated = losses.sigmoid_cross_entropy(
467 loss_collection=ops.GraphKeys.LOSSES,
468 reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
492 reduction: A `tf.losses.Reduction` to apply to loss.
517 loss_collection=ops.GraphKeys.LOSSES,
518 reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
540 reduction: A `tf.losses.Reduction` to apply to loss.
563 loss_collection=ops.GraphKeys.LOSSES,
564 reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
586 reduction: A `tf.losses.Reduction` to apply to loss.
594 loss = losses.sigmoid_cross_entropy(
614 loss_collection=ops.GraphKeys.LOSSES,
615 reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
637 reduction: A `tf.losses.Reduction` to apply to loss.
648 loss = losses.compute_weighted_loss(
665 loss_collection=ops.GraphKeys.LOSSES,
666 reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
692 reduction: A `tf.losses.Reduction` to apply to loss.
710 loss_on_real = losses.compute_weighted_loss(
713 loss_on_generated = losses.compute_weighted_loss(
759 loss_collection=ops.GraphKeys.LOSSES,
760 reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
777 reduction: A `tf.losses.Reduction` to apply to loss.
790 loss = -1 * losses.compute_weighted_loss(
849 """Utility to combine main and adversarial losses.
851 This utility combines the main and adversarial losses in one of two ways.
854 used to make sure both losses affect weights roughly equally, as in
858 losses.
874 scalar_summaries: Create scalar summaries of losses.
875 gradient_summaries: Create gradient summaries of losses.
905 # Combine losses in the appropriate way.