18/26
Part 3 of 4 · Picking entries out of a tableWatch
Watch · 2 min

Karpathy needs the probability his model gave the right next character, for each of 5 examples. He pairs torch.arange(5) with the labels to pull out one number per row, then averages their negative logs into the loss. NumPy indexes the same way.

The spelled-out intro to language modeling: building makemore · Andrej Karpathy · Sep 2022YouTube