6/26
Part 1 of 4 · Shapes and axesWatch
Watch · 4 min

Karpathy wants each row of a 27 by 27 table of counts to add up to 1. He sums along one dimension and compares the shapes he gets back. With keepdim he gets a 1 by 27 row or a 27 by 1 column, and without it a flat 27. PyTorch says dim and keepdim where NumPy says axis and keepdims.

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