(output_fake,
                     output_real,
                     real_label_val=1.0,
                     fake_label_val=0.0,
                     **kwargs)
return loss
r"""
    Standard minimax loss for GANs through the BCE Loss with logits fn.

    Args:
        output_fake (Tensor): Discriminator output logits for fake images.
        output_real (Tensor): Discriminator output logits for real images.
        real_label_val (int): Label for real images.
        fake_label_val (int): Label for fake images.
        device (torch.device): Torch device object for sending created data.

    Returns:
        Tensor: A scalar tensor loss output.
r"""
    Standard minimax loss for GANs through the BCE Loss with logits fn.
r Standard minimax loss for GANs through the BCE Loss with logits fn .
def minimax_loss_dis(output_fake,
                     output_real,
                     real_label_val=1.0,
                     fake_label_val=0.0,
                     **kwargs):
    r"""
    Standard minimax loss for GANs through the BCE Loss with logits fn.

    Args:
        output_fake (Tensor): Discriminator output logits for fake images.
        output_real (Tensor): Discriminator output logits for real images.
        real_label_val (int): Label for real images.
        fake_label_val (int): Label for fake images.
        device (torch.device): Torch device object for sending created data.

    Returns:
        Tensor: A scalar tensor loss output.
    """
    # Produce real and fake labels.
    fake_labels = zeros((output_fake.shape[0], 1)) + fake_label_val
    real_labels = zeros((output_real.shape[0], 1)) + real_label_val

    # FF, compute loss and backprop D
    errD_fake = _bce_loss_with_logits(output=output_fake,
                                      labels=fake_labels,
                                      **kwargs)

    errD_real = _bce_loss_with_logits(output=output_real,
                                      labels=real_labels,
                                      **kwargs)

    # Compute cumulative error
    loss = errD_real + errD_fake

    return loss
def minimax_loss_dis ( output_fake , output_real , real_label_val = 1.0 , fake_label_val = 0.0 , * * kwargs ) : # Produce real and fake labels. fake_labels = zeros ( ( output_fake . shape [ 0 ] , 1 ) ) + fake_label_val real_labels = zeros ( ( output_real . shape [ 0 ] , 1 ) ) + real_label_val # FF, compute loss and backprop D errD_fake = _bce_loss_with_logits ( output = output_fake , labels = fake_labels , * * kwargs ) errD_real = _bce_loss_with_logits ( output = output_real , labels = real_labels , * * kwargs ) # Compute cumulative error loss = errD_real + errD_fake return loss