Repository navigation
Add modules.PreNormTransformerBlock / PostNormTransformerBlock; EEGConformer, MIRepNet, CTNet, MSCFormer use them - #1466
Merged
bruAristimunha merged 1 commit intoOct 18, 2026
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1466 +/- ##
==========================================
- Coverage 91.03% 91.00% -0.04%
==========================================
Files 167 167
Lines 21601 21516 -85
==========================================
- Hits 19665 19580 -85
Misses 1936 1936 🚀 New features to boost your workflow:
|
bruAristimunha
force-pushed
the
cleanup/t27-encoder-blocks
branch
from
October 18, 2026 11:16
3e3be5c to
7bf0ffa
Compare
bruAristimunha
force-pushed
the
cleanup/t27-encoder-blocks
branch
from
October 18, 2026 17:31
2f2a7ca to
d8a5c88
Compare
…nformer, MIRepNet, CTNet, MSCFormer use them (same keys, same outputs)
bruAristimunha
force-pushed
the
cleanup/t27-encoder-blocks
branch
from
October 18, 2026 18:23
d8a5c88 to
1eaa722
Compare
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.
Part of #1442. Stacked on #1463 (chain #1455 → #1463); the commit of this PR is the last one.
Four models carried a
_TransformerEncoderBlock+_TransformerEncoderpair (eight private classes) that differed only in argument names:Residual(LayerNorm → MHA → Dropout),Residual(LayerNorm → FFN → Dropout)→modules.PreNormTransformerBlock(dim, attn, ffn, drop_prob), annn.Sequentialso the indexed keys (transformer.0.0.fn.1.keys.weight) stay as released (MIRepNet's hub weights load).PostNormResidual(MHA),PostNormResidual(FFN)→modules.PostNormTransformerBlock(dim, attn, ffn, drop_prob)with theattention/feed_forwardnames. The_TransformerEncoderwrapper becomesnn.Sequential(OrderedDict(layers=...)), which keeps thetrans.layers.Nkeys of saved checkpoints; CTNet keeps the extraSequentialaround its sub-layers for the same reason.Characterization vs master: EEGConformer, MIRepNet, CTNet, MSCFormer (and STEEGFormer, untouched): identical state_dict keys and weights, bit-identical outputs;
MIRepNet.from_pretrained('braindecode/mirepnet-pretrained')loads. 170 related tests pass. −8 private classes (growth-stop list updated).