import torch


def discriminator_loss(logits_r,logits_m,logits_f,logits_f_prime):
    """
    Computes the discriminator loss described in the homework pdf
    using the bce_loss function.
    
    Inputs:
    - logits_r: PyTorch Variable of shape (N,) giving scores for the real data.
    - logits_f: PyTorch Variable of shape (N,) giving scores for the fake data.
    
    Returns:
    - loss: PyTorch Variable containing (scalar) the loss for the discriminator.
    """
    ###########################
    ######### TO DO ###########
    ###########################
    loss = None
    loss = torch.log(logits_r) + 0.5*(torch.log(1-logits_m)+0.5*(torch.log(1-logits_f)+torch.log(1-logits_f_prime)))
    loss = loss.mean()
    return loss