Repository navigation
feat: add minimalrnn cell - #55
Merged
Merged
Conversation
Ports MinimalRNN (Chen et al. 2017, arXiv:1711.06788), found missing by diffing against the sister Julia libraries RecurrentLayers.jl and LuxRecurrentLayers.jl. Follows the MGUCell/MGU pattern, exported from both package entry points, with tests and docs added. Also fixes a pre-existing E402 import-order lint error in tests/test_cells.py, surfaced now that the local pre-commit ruff hook runs successfully for the first time on this machine. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Two repo-wide issues surfaced by the Codex audit on the MinimalRNN PR, fixed here per follow-up request: - base.py's _cleanup_non_scriptable() deleted init_cfg right after __init__ used it once, so cell.reset_parameters() raised AttributeError if called again after construction, on every cell in the library. init_cfg (a Dict[str, str]) is TorchScript-compatible, so it's now kept. Added a parametrized regression test over CELL_CASES. - Every layer's docstring (RNN-style multi-timestep classes) claimed support for 2D unbatched input and PackedSequence input that RecurrentLayerBase.forward never implemented (it unconditionally unpacks a 3D tensor). Corrected the Inputs/Outputs sections across all affected cells to describe only the 3D batch_first-aware shapes that are actually supported, and removed the now-inapplicable ``batch_first`` "ignored for unbatched inputs" note. No behavior change; single-timestep Cell classes were unaffected since they already correctly document 1D/2D support. Touching these files also pulled in some pre-existing, unrelated formatting/lint debt (long import lines, unused imports, one ambiguous variable name) that the repo's pre-commit hooks had apparently never actually been run against locally; fixed those incidentally via black/ruff --fix plus one manual rename. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #55 +/- ##
==========================================
+ Coverage 95.10% 95.18% +0.08%
==========================================
Files 42 43 +1
Lines 2573 2619 +46
==========================================
+ Hits 2447 2493 +46
Misses 126 126 ☔ 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.