mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-16 14:42:29 -05:00
The module declares rng = np.random.default_rng(7) at the top so that all stochastic operations are reproducible for a given seed. Dropout ignored this and called np.random.random(shape), which draws from the global unseeded state. Masks were different on every run even when the module seed was set, making Dropout unit tests non-reproducible and causing hard-to-debug numerical differences between training runs. Changed to rng.random(shape) so Dropout participates in the same reproducible stream as every other random operation in the module.