A one-hot target collapses the sum before any logarithm is evaluated. The zero target entries drop structurally, leaving only the correct class probability.

highlighted = computed this step

The zero target terms vanish

The target is one-hot, so two entries are exactly 0. Those entries multiply their log terms by zero and drop structurally. The correct class has target entry 1, so only its probability remains in the loss.

yi=0yilog(pi) dropsy_i=0\Rightarrow y_i\log(p_i)\text{ drops}
Cross-entropy exactlyOne-hot selection with named log boundary.cross-entropy term selectionclassy_ip_itermA01/40 (one-hot drop)B11/2-log(1/2)C01/40 (one-hot drop)H=-log(1/2)exact one-hot selection plus named log boundary; one loss on one pinned probabilitydistribution; NOT learning

One term is selected

The selected probability is 1/2. Therefore the full sum collapses exactly to a single named term: minus log of 1/2.

H=log(1/2)H=-\log(1/2)
Cross-entropy exactlyOne-hot selection with named log boundary.cross-entropy term selectionclassy_ip_itermA01/40 (one-hot drop)B11/2-log(1/2)C01/40 (one-hot drop)H=-log(1/2)exact one-hot selection plus named log boundary; one loss on one pinned probabilitydistribution; NOT learning

Summary

The collapse is exact and does not require evaluating a logarithm. One-hot selection is arithmetic structure; the log value remains outside the exact register.

one-hot selection is exact\text{one-hot selection is exact}
Cross-entropy exactlyOne-hot selection with named log boundary.cross-entropy term selectionclassy_ip_itermA01/40 (one-hot drop)B11/2-log(1/2)C01/40 (one-hot drop)H=-log(1/2)exact one-hot selection plus named log boundary; one loss on one pinned probabilitydistribution; NOT learning