Code QuizIntermediate

Cross-Entropy Loss Computation

Spot the missing log in this cross-entropy loss function.

Codepython
import numpy as np

def cross_entropy(y_true, y_pred):
    # y_true one-hot, y_pred softmax probs
    return -np.sum(y_true * y_pred)

What is the bug in this cross-entropy computation?