Implement categorical cross-entropy loss.
Signature: def cross_entropy(y_pred: np.ndarray, y_true: np.ndarray) -> float
def cross_entropy(y_pred: np.ndarray, y_true: np.ndarray) -> float
Clip predictions to avoid log(0).
Math
Asked at
Test Results