DiscriminatorMinMax

Inheritance Diagram

Inheritance diagram of ashpy.losses.gan.DiscriminatorMinMax

class ashpy.losses.gan.DiscriminatorMinMax(from_logits=True, label_smoothing=0.0)[source]

Bases: ashpy.losses.gan.AdversarialLossD

The min-max game played by the discriminator.

\[L_{D} = - \frac{1}{2} E [\log(D(x)) + \log (1 - D(G(z))]\]

Methods

__init__([from_logits, label_smoothing])

Initialize Loss.

Attributes

fn

Return the Keras loss function to execute.

global_batch_size

Global batch size comprises the batch size for each cpu.

weight

Return the loss weight.

class GANLoss(from_logits=True, label_smoothing=0.0)[source]

Bases: tensorflow.python.keras.losses.Loss

Implementation of MinMax loss as tf.keras.losses.Loss.

__init__(from_logits=True, label_smoothing=0.0)[source]

Initialize the loss.

Return type

None

call(d_real, d_fake)[source]

Compute the MinMax Loss.

Play the DiscriminatorMinMax game between the discriminator computed in real and the discriminator compute with fake inputs.

Parameters
Return type

Tensor

Returns

tf.Tensor – Output Tensor.

property reduction

Return the reduction type of this loss.

Return type

ReductionV2

Returns

:py:classes:`tf.keras.losses.Reduction` – Reduction.

__init__(from_logits=True, label_smoothing=0.0)[source]

Initialize Loss.