Repository navigation
release: v1.8.2 - #1533
release: v1.8.2#1533
Conversation
…ecode#1501) * FIX FilterBankLayer TorchScript with PyTorch 2.15 PyTorch 2.15 added torch.autograd.Function.input_grad_buffers, annotated tuple[Tensor | None, ...], which TorchScript cannot parse. Scripting FilterBankLayer compiles torchaudio's lfilter, whose DifferentiableFIR and DifferentiableIIR are autograd.Function subclasses, so FBCNet, FBMSNet, FBLightConvNet and IFNet no longer script. Eager filtering keeps calling torchaudio. The scripted path runs the ops torchaudio's own scripted path runs (FIR conv1d, then its IIR core loop), so scripted outputs are unchanged. _apply_iir calls lfilter or filtfilt in an if/else, since the helpers no longer take torchaudio's clamp argument. * DOC whats_new: PR number for braindecode#1501 * TST cover the scripted lfilter ops in eager mode Coverage cannot trace code that only runs inside TorchScript. Call the scripted ops directly as well and check them against torchaudio bit for bit, and check the Python core-loop fallback against torchaudio's loop. (cherry picked from commit 9db6051)
…decode#1164) * Fix FutureWarning for renamed standard montages on MNE >= 1.13 MNE 1.13 renamed standard_1005/standard_1020 to colin27_1005/ colin27_1020 and deprecated the legacy names, which will raise in MNE 1.14. braindecode supports mne>=1.11, where only the legacy names exist, so the spelling is now resolved against the installed MNE version via the new braindecode.util.resolve_montage_name() and used at every internal montage lookup (eegpt, dgcnn, interpolated, tuh, augmentation transforms). Fixes braindecode#1163 * Make test_always_mode_uses_mne_even_when_names_match numerically robust The old assertion required the MNE spline matrix for a channel set interpolated onto its own positions to have off-diagonal structure > 1e-6, but self-interpolation is (correctly) numerically exact identity, so the test failed on all CI platforms. Rework the test to use the same channel names at different positions: name_match yields the permutation matrix, while always mode must compute the MNE spline onto the new positions, which mixes several sources per target row (off-diagonal weights O(0.1-1), stable across platforms) and preserves constant signals (row sums = 1). --------- Co-authored-by: LiQing <[email protected]> (cherry picked from commit f6144d3)
…chaudio < 2.11 Backport of the master test fix (bd2deep/lfilter-test-torch26): on the torch/torchaudio 2.6 floor, torchaudio's eager IIR recursion rounds differently from the ops of its scripted path.
Patch release of the 1.8 series: version 1.8.2 and its whats_new section. Backports braindecode#1501 (TorchScript of the filter-bank models on PyTorch 2.15) and braindecode#1164 (MNE >= 1.13 montage renames: FutureWarning at import, error from MNE 1.14).
|
CI note: |
There was a problem hiding this comment.
🟡 Changes recommended
On MNE versions before 1.13, the new Colin27 montage names are not translated to their legacy equivalents, breaking documented support for either spelling.
1 open issue
What changed in this PR
This patch release prepares Braindecode 1.8.2 with compatibility backports for PyTorch filtering and MNE montage names.
Changes:
- Add TorchScript-safe filtering helpers while preserving eager torchaudio behavior.
- Resolve renamed MNE montages across affected models, datasets, and augmentations.
- Update regression tests, API documentation, release notes, and the package version.
| File | Description |
|---|---|
test/unit_tests/test_util.py |
Add montage-resolution and warning regression tests. |
test/unit_tests/models/test_modules.py |
Test scripted filtering, fallback recursion, and version-dependent tolerances. |
test/unit_tests/models/test_interpolation.py |
Use distinct positions to distinguish interpolation modes. |
docs/whats_new.rst |
Document the 1.8.2 fixes and contributor credit. |
docs/api.rst |
Expose the montage resolver in API documentation. |
braindecode/version.py |
Set the version to 1.8.2. |
braindecode/util.py |
Add version-aware montage-name resolution. |
braindecode/modules/filter.py |
Route filtering through TorchScript-safe helpers. |
braindecode/models/interpolated.py |
Resolve montage names before building channel metadata. |
braindecode/models/eegpt.py |
Resolve montage names during channel initialization. |
braindecode/models/dgcnn.py |
Resolve the montage used to infer electrode positions. |
braindecode/functional/_lfilter.py |
Add eager and scripted filtering implementations. |
braindecode/datasets/tuh.py |
Resolve montages for channel naming and positioning. |
braindecode/augmentation/transforms.py |
Resolve sensor-position montages and annotate the example. |
braindecode/augmentation/functional.py |
Annotate the montage rename in the rotation example. |
Review effort: Balanced
| new_name = _RENAMED_STANDARD_MONTAGES.get(name) | ||
| if new_name is not None and new_name in mne.channels.get_builtin_montages(): | ||
| return new_name | ||
| return name |

Patch release 1.8.2 on the new
maint/1.8.xbranch (created at v1.8.1, 85b8b5c). Four commits:798dab34Port of FIX FilterBankLayer TorchScript with PyTorch 2.15 (master CI) #1501:FilterBankLayerroutes its IIRlfilter/filtfiltcalls through TorchScript-safe helpers. Released 1.8.1 cannottorch.jit.scriptFBCNet, FBMSNet, FBLightConvNet or IFNet on PyTorch 2.15, which is what made MOABB's CI red. The 1.8.1 FIR path is unchanged.0ef82348Cherry-pick of Fix FutureWarning for renamed standard montages on MNE >= 1.13 #1164:braindecode.util.resolve_montage_namepickscolin27_10xxon MNE >= 1.13. This removes the FutureWarning thatimport braindecode.modelsraises today. Once MNE 1.14 removes the old names, that import would fail outright.5f9f2ebcTest only, the same change as TST scripted lfilter: float64 rounding instead of bit-equality on torchaudio < 2.11 (torch 2.6 floor) #1527. On torchaudio < 2.11 the scripted-lfilter test compares with float64 tolerance instead of bit equality.c440cd25release: v1.8.2sets__version__ = "1.8.2"and adds aCurrent 1.8.2 (2026-11-02)section to whats_new.Verified in Voyager Jobs against the installed wheel, with the source tree removed from the test root:
For comparison, v1.8.1 on torch 2.15 gives 6 failures.
Merge with Rebase and merge so the backports stay separate commits and
release: v1.8.2stays last. This branch must not be merged into master.