|View source on GitHub|
Original minimax discriminator loss for GANs, with label smoothing.
tf.contrib.gan.losses.wargs.minimax_discriminator_loss( discriminator_real_outputs, discriminator_gen_outputs, label_smoothing=0.25, real_weights=1.0, generated_weights=1.0, scope=None, loss_collection=tf.GraphKeys.LOSSES, reduction=losses.Reduction.SUM_BY_NONZERO_WEIGHTS, add_summaries=False )
Note that the authors don't recommend using this loss. A more practically
useful loss is
L = - real_weights * log(sigmoid(D(x))) - generated_weights * log(1 - sigmoid(D(G(z))))
Generative Adversarial Nets (https://arxiv.org/abs/1406.2661) for more
discriminator_real_outputs: Discriminator output on real data.
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 from
Improved Techniques for Training GANs(https://arxiv.org/abs/1606.03498).
0.0means no smoothing.
Tensorwhose rank is either 0, or the same rank as
real_data, and must be broadcastable to
real_data(i.e., all dimensions must be either
1, or the same as the corresponding dimension).
generated_weights: Same as
real_weights, but for
scope: The scope for the operations performed in computing the loss.
loss_collection: collection to which this loss will be added.
tf.compat.v1.losses.Reductionto apply to loss.
add_summaries: Whether or not to add summaries for the loss.
A loss Tensor. The shape depends on