import torch


def reg_binary_entropy_loss(out):
    """
    Mean binary entropy loss to drive values toward 0 and 1.

    Args:
        out (torch.float): Values for the binary entropy loss. The values have to be 
        within (0, 1).

    Return:
        torch.float for the loss value.
    """
    return torch.mean(-out * torch.log(out) - (1 - out) * torch.log(1 - out))