def discriminator_loss_fct(real_output, generated_output):
        """Discriminator loss

        The discriminator loss function takes two inputs: real images, and generated images. Here is how to calculate
        the discriminator loss:
        1. Calculate real_loss which is a sigmoid cross entropy loss of the real images and an array of ones (since
        these are the real images).
        2. Calculate generated_loss which is a sigmoid cross entropy loss of the generated images and an array of
        zeros (since these are the fake images).
        3. Calculate the total_loss as the sum of real_loss and generated_loss.
        """
        # [1,1,...,1] with real output since it is true, and we want our generated examples to look like it
        real_loss = tf.compat.v1.losses.sigmoid_cross_entropy(
            multi_class_labels=tf.ones_like(real_output), logits=real_output
        )

        # [0,0,...,0] with generated images since they are fake
        generated_loss = tf.compat.v1.losses.sigmoid_cross_entropy(
            multi_class_labels=tf.zeros_like(generated_output), logits=generated_output
        )

        total_loss = real_loss + generated_loss

        return total_loss
Discriminator loss

        The discriminator loss function takes two inputs: real images, and generated images. Here is how to calculate
        the discriminator loss:
        1. Calculate real_loss which is a sigmoid cross entropy loss of the real images and an array of ones (since
        these are the real images).
        2. Calculate generated_loss which is a sigmoid cross entropy loss of the generated images and an array of
        zeros (since these are the fake images).
        3. Calculate the total_loss as the sum of real_loss and generated_loss.
        
tests/utils.py