ML Course: Solution Articles for New Problems - #5696
Merged
Conversation
Add solution articles for multi-layer backpropagation, weight initialization, and batch normalization. These follow the same format as the existing 27 ML solution articles (Prerequisites, Concept, Solution with Python tabs, Common Pitfalls, In the GPT Project, Key Takeaways). Made-with: Cursor
- multi-headed-self-attention: Add output_proj (W_o) linear layer after concatenating heads, matching standard practice - transformer-block: Add output_proj to inner MultiHeadedSelfAttention class, consistent with multi-head attention problem - weight-initialization: Rewrite check_activations to use raw weight matrices (torch.randn * std) instead of nn.Linear for cross-platform determinism Made-with: Cursor
Reduces precision from 4 to 2 decimal places for the check_activations method to absorb cross-platform floating point differences in multi-layer matrix operations. Made-with: Cursor
- Remove softmax from solution, return raw logits - Add W_o output projection to inner MHA class - Update all explanatory text: probabilities → logits - Update shape table and key takeaways Made-with: Cursor
- rms-normalization.md — RMSNorm vs LayerNorm, numpy implementation, Llama/Mistral context - training-diagnostics.md — 3-method class (activation stats, gradient stats, diagnose), Karpathy debugging recipe Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two new ML course problems (PR4), bringing total to 34. Dead ReLU Detector: detect_dead_neurons + suggest_fix with priority-ordered diagnostic rules. 8 test cases covering all fix branches. Tokenization Edge Cases: greedy tokenization exposing number inconsistency, token counting, and fertility scoring. 8 test cases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Made-with: Cursor
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.
Summary
Replaces previously merged chained PRs (#5666, #5668, #5674, #5688, #5689) which merged into each other instead of main.
Test plan
Made with Cursor