Repository navigation
Feat: add mgu variants and elstm - #57
Merged
Merged
Conversation
MGU1-3 (Heck & Salem, MWSCAS 2017; RecurrentLayers.jl#157) reduce the MGU forget gate: MGU1 drops the input term, MGU2 also drops the bias, MGU3 keeps only a learnable bias_f. The candidate and update are MGU's. eLSTM (Irie et al., arXiv:2305.19044; RecurrentLayers.jl#94) is an LSTM whose forget gate and candidate see c(t-1) only through element-wise weights (weight_c), with an output gate on c(t) via weight_hh. Only c recurs, so it is built on the decoupled single-state bases like IntersectionRNN: h feeds the next layer, c_n is returned as state. weight_c defaults to uniform in [-0.1, 0.1], close to the reference code's N(0, 0.1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Disabled biases are registered as zero buffers, so the `if hasattr(self, "bias_*")` guards in 15 custom reset_parameters were always true: a non-zero bias_init / recurrent_bias_init (e.g. "ones") overwrote biases the user had turned off. Guard on nn.Parameter instead, which covers bias_ih, bias_hh, bias_ch and bias_mh regardless of which flag controls them. The base reset_parameters was already correct since it iterates named_parameters. Adds test_cell_disabled_biases_stay_zero over every cell; it failed for 19 cells before this change. Found by Codex review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #57 +/- ##
==========================================
+ Coverage 96.24% 96.50% +0.26%
==========================================
Files 46 47 +1
Lines 3489 3750 +261
==========================================
+ Hits 3358 3619 +261
Misses 131 131 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
No description provided.