[GH-ISSUE #1611] [Bug] Milestone 1: the weights of the Perceptron never change #27923

Closed
opened 2026-06-20 11:56:08 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @AndreaMattiaGaravagno on GitHub (Apr 30, 2026).
Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1611

Area

TinyTorch

Location

Milestone 1

Description

Milestone 1: the weights of the Perceptron never change

Expected Behavior

The weights of the Perceptron should change between different runs

Environment (TinyTorch bugs only)

Tiny🔥Torch v0.1.10
Python 3.12.3
/home/andre/tinytorch/.venv

Originally created by @AndreaMattiaGaravagno on GitHub (Apr 30, 2026). Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1611 ### Area TinyTorch ### Location Milestone 1 ### Description Milestone 1: the weights of the Perceptron never change ### Expected Behavior The weights of the Perceptron should change between different runs ### Environment (TinyTorch bugs only) Tiny🔥Torch v0.1.10 Python 3.12.3 /home/andre/tinytorch/.venv
GiteaMirror added the area: tinytorchtype: bug labels 2026-06-20 11:56:09 -05:00
Author
Owner

@profvjreddi commented on GitHub (Apr 30, 2026):

Fixed in #1617 (merged to dev as cb68c293d). Module-level rng = np.random.default_rng(7) in tinytorch/src/03_layers/03_layers.py was reused by every Linear() weight init, making weights deterministic across runs despite the milestone's on-screen "no random seed" message. Both that seed and the milestone's own data RNG seed are now unseeded. Verified by two-run diff: weights and accuracy now vary.

<!-- gh-comment-id:4356773998 --> @profvjreddi commented on GitHub (Apr 30, 2026): Fixed in #1617 (merged to dev as cb68c293d). Module-level `rng = np.random.default_rng(7)` in `tinytorch/src/03_layers/03_layers.py` was reused by every `Linear()` weight init, making weights deterministic across runs despite the milestone's on-screen "no random seed" message. Both that seed and the milestone's own data RNG seed are now unseeded. Verified by two-run diff: weights and accuracy now vary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#27923