tf.contrib.gan.losses.wargs.minimax_generator_loss(
discriminator_gen_outputs,
label_smoothing=0.0,
weights=1.0,
scope=None,
loss_collection=tf.GraphKeys.LOSSES,
reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
add_summaries=False
)
Defined in tensorflow/contrib/gan/python/losses/python/losses_impl.py
.
Original minimax generator loss for GANs.
Note that the authors don't recommend using this loss. A more practically
useful loss is modified_generator_loss
.
L = log(sigmoid(D(x))) + log(1 - sigmoid(D(G(z))))
See Generative Adversarial Nets
(https://arxiv.org/abs/1406.2661) for more
details.
Args:
discriminator_gen_outputs
: Discriminator output on generated data. Expected to be in the range of (-inf, inf).label_smoothing
: The amount of smoothing for positive labels. This technique is taken fromImproved Techniques for Training GANs
(https://arxiv.org/abs/1606.03498).0.0
means no smoothing.weights
: OptionalTensor
whose rank is either 0, or the same rank asdiscriminator_gen_outputs
, and must be broadcastable todiscriminator_gen_outputs
(i.e., all dimensions must be either1
, or the same as the corresponding dimension).scope
: The scope for the operations performed in computing the loss.loss_collection
: collection to which this loss will be added.reduction
: Atf.losses.Reduction
to apply to loss.add_summaries
: Whether or not to add summaries for the loss.
Returns:
A loss Tensor. The shape depends on reduction
.