Binary sigmoid chooses between two outcomes. Multiclass classification needs every candidate class to compete for one shared unit of confidence, then needs a loss that scores only the probability assigned to each example's true class.
Implement row-wise softmax(Z) and cce_loss(P, y_indices). Theory maps the stable normalization and the one-correct-class lookup to the exact NumPy operations.
Z and P have shape (n_samples, n_classes); each softmax row sums to one.y_indices has one integer class index per sample.[1e-12, 1.0], and return a Python float.P[np.arange(n), y_indices], not an all-rows column selection.Open one at a time. Each gives away a little more than the last.
Rows are independent probability distributions, so reductions must use axis=1 and preserve the column dimension.
Build row indices with np.arange(P.shape[0]); pair them with y_indices to gather exactly one value from each row.
No results yet
Run your code to check it against the examples, or submit to run every test.