A batch loss averages row losses. This lesson keeps each selected probability exact, keeps each log loss named, and averages the named expressions symbolically.

highlighted = computed this step

Two rows in the batch

The tiny batch has row 1 with target B and selected probability 1/2. Row 2 has target A and selected probability 3/4. Each selected probability comes from that row's displayed probability vector.

ptrue,row 1=1/2,ptrue,row 2=3/4p_{\text{true,row }1}=1/2,\quad p_{\text{true,row }2}=3/4
Average Over a Tiny BatchEach row selects an exact probability; the log losses stay named.average named losses over two rowsrowtargetp vectorp_truenamed lossrow 1B(1/2, 1/2)1/2-log(1/2)row 2A(3/4, 1/4)3/4-log(3/4)batch average=(-log(1/2)+-log(3/4))/2average exact symbolic losses; log values stay namedexact one-hot selection plus named log boundary; one loss on one pinned probabilitydistribution; NOT learning

Keep each log named

Row 1 contributes -log(1/2). Row 2 contributes -log(3/4). The table names those two losses and does not evaluate either logarithm.

H1=log(1/2),H2=log(3/4)H_1=-\log(1/2),\quad H_2=-\log(3/4)
Average Over a Tiny BatchEach row selects an exact probability; the log losses stay named.average named losses over two rowsrowtargetp vectorp_truenamed lossrow 1B(1/2, 1/2)1/2-log(1/2)row 2A(3/4, 1/4)3/4-log(3/4)batch average=(-log(1/2)+-log(3/4))/2average exact symbolic losses; log values stay namedexact one-hot selection plus named log boundary; one loss on one pinned probabilitydistribution; NOT learning

Average the symbols

The batch loss is the exact average of the two named losses shown in the table. This is only the displayed two-row batch average; no log decimal or broader claim is added.

Hbatch=log(1/2)+log(3/4)2H_{\text{batch}}=\frac{-\log(1/2)+-\log(3/4)}{2}
Average Over a Tiny BatchEach row selects an exact probability; the log losses stay named.average named losses over two rowsrowtargetp vectorp_truenamed lossrow 1B(1/2, 1/2)1/2-log(1/2)row 2A(3/4, 1/4)3/4-log(3/4)batch average=(-log(1/2)+-log(3/4))/2average exact symbolic losses; log values stay namedexact one-hot selection plus named log boundary; one loss on one pinned probabilitydistribution; NOT learning