import torch


def cross_entropy_soft_targets(predicted_distribution, target_distribution):
    """Cross entropy loss with soft targets.
    B = batch size, D = dimension of target (num classes), N = ensemble size

    Args:
        inputs (torch.tensor((B, D - 1))): predicted distribution
        soft_target (torch.tensor((B, D - 1))): target distribution
    """

    return torch.mean(-target_distribution * torch.log(predicted_distribution))