mirror of
https://github.com/rohitg00/ai-engineering-from-scratch.git
synced 2026-10-02 01:54:39 +08:00
train() shuffled data in place but indexed sample_weights by the enumerate position on the shuffled list, so weights were misaligned after the first shuffle. Pair each example with its weight before shuffling so weights stay bound to their examples. Also avoids mutating the caller's list.