def soft_crossentropy(predicted_logprobs, target_probs):
    """
    Cross-entropy loss capable of handling soft target probabilities.
    """
    return -(target_probs * predicted_logprobs).sum(1).mean(0)