Add optimizer exercises (Adam, AdamW, Muon) - #28
Open
ezhoureal wants to merge 3 commits into
Open
Conversation
|
@ezhoureal is attempting to deploy a commit to the exorust's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
ezhoureal
added a commit
to ezhoureal/TorchLeet
that referenced
this pull request
Aug 26, 2026
…orust#28) Co-Authored-By: Claude <noreply@anthropic.com>
…/ Muon) Replaces the single combined optimizer exercise (v1-36) with three registered problems, each with its own question + solution notebook pair and grader spec: - torch/hard/optimizers/adam/ (v1-36) — MyAdam, 3 checks - torch/hard/optimizers/adamw/ (v1-37) — MyAdamW, 2 checks - torch/hard/optimizers/muon/ (v1-38) — newton_schulz + MyMuon, 6 checks Generated catalogue files (problems.json, space/, website data, PROBLEMS.md, README counts) regenerated to 68 problems / 62 auto-graded. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three new Hard problems under
torch/hard/optimizers/, one per optimizer, each in the repo's templateQ+_SOLNnotebook format and fully auto-graded. Replaces the earlier single combined "Optimizers" exercise.What's included
v1-36torch/hard/optimizers/adam/MyAdam)v1-37torch/hard/optimizers/adamw/MyAdamW)v1-38torch/hard/optimizers/muon/newton_schulz,MyMuon)Each problem has its own
problem.toml(difficulty hard, companies Meta + Google), question notebook with Colab badge +check("…", ...)line, and solution notebook with blanked-out answers.Validation
torch.optim.Adamon a quadratic bowl; bias correction pinned by a hand-derived first step (-lr·sign(grad)from zero state).torch.optim.AdamW; decoupled decay pinned by a zero-gradient parameter that must still shrink by(1 - lr·weight_decay)— fails Adam + L2.newton_schulzchecked as geometry (orthonormal rows/columns, scale invariance, orthogonal matrices as fixed points); Muon checked for orthogonal update directions, the AdamW fallback for 1-D parameters, and loss convergence on a small linear model.Grader specs in
python/torchleet/problems/{adam,adamw,muon}.py(11 checks total) wired into the autograder with generated hints, and registered asv1-36/37/38inmcp-server/src/data/questions.ts,problems.json,space/problems.json, and the generated website/MCP data. README and PROBLEMS.md updated → 68 problems total, 62 auto-graded.The superseded
.pyexercise files undertorch/were removed (notebook format is canonical).Checks
scripts/generate.py check— 0 problems;coverage— 62/68 auto-gradedpython/test_grader.py— 8/8 passscripts/validate_specs.py adam adamw muon— all 3 solutions pass their own checks