Let parameters declare their own initializer - #70
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #70 +/- ##
==========================================
+ Coverage 93.67% 93.71% +0.04%
==========================================
Files 45 45
Lines 1770 1783 +13
==========================================
+ Hits 1658 1671 +13
Misses 112 112 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jessegrabowski
added a commit
that referenced
this pull request
Aug 10, 2026
* Assert each layer declares the initializers its parameters need Passes as written: it pins the behavior gh #70 established so the initializer keywords landing next cannot quietly strip a declaration, which is the one way they break something. * Add a normal initializer Its two arguments both default, which is what lets it into a registry whose entries are built with no arguments; a differently parameterized initializer can only be passed as an instance. * Let Linear take its weight and bias initializers * Let Embedding take its weight initializer * Let the norm layers take their affine initializers * Cite Glorot and Bengio on the Xavier initializers
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.
Model.initializemapped one scheme over every trainable parameter, soxavier_normalreplaced batch norm's unit scale and zero shift with random draws — the layer then starts by scaling activations toward zero, sign flips included, and trains anyway, just worse. Bias vectors got the same treatment from a fan-based formula that means nothing for a 1-D vector. Parameters can now declare an initializer that a network-wide scheme leaves alone.