braindecode/models/eegitnet.py diverges from the authors' EEG-ITNet (Salami et al. 2022, Main.ipynb) in two ways that materially hurt within-subject accuracy (~11pp on BCI-IV-2a in a replicability study; the model overfits without them):
1. Missing max_norm weight constraints
The source constrains the regularizing weights; braindecode applies none (grep -c max_norm eegitnet.py == 0):
- the 3 inception spatial depthwise convs (
Spatial_filter_1/2/3) use depthwise_constraint = MaxNorm(max_value=1);
- the final dense uses
kernel_constraint = max_norm(0.25).
braindecode already ships the primitives (Conv2dWithConstraint, MaxNormLinear, MaxNormParametrize) and uses them in EEGNetv4 — they were just omitted here. The dilated TC blocks correctly have no constraint in the source, so leave those unconstrained.
2. Dimensionality-reduction width doubled (28 vs 14)
The source DR conv has 14 filters (paper III-C: "the number of filters in the 1×1 convolutional layer … was selected to be 14"; source Conv2D(14,(1,1))). braindecode doubles it (eegitnet.py:188):
nn.Conv2d(tcn_in_channel, tcn_in_channel * 2, kernel_size=(1, 1)), # 14 -> 28
nn.BatchNorm2d(tcn_in_channel * 2),
This inflates the classifier input (644 vs 322 features) and adds capacity.
Fix
Apply MaxNormParametrize(1.0) to the 3 inception spatial depthwise convs and MaxNormLinear(max_norm=0.25) (or parametrize) to the final layer; set the DR conv width to tcn_in_channel (14). Both are verified against the authors' code. Happy to PR.
braindecode/models/eegitnet.pydiverges from the authors' EEG-ITNet (Salami et al. 2022,Main.ipynb) in two ways that materially hurt within-subject accuracy (~11pp on BCI-IV-2a in a replicability study; the model overfits without them):1. Missing
max_normweight constraintsThe source constrains the regularizing weights; braindecode applies none (
grep -c max_norm eegitnet.py == 0):Spatial_filter_1/2/3) usedepthwise_constraint = MaxNorm(max_value=1);kernel_constraint = max_norm(0.25).braindecode already ships the primitives (
Conv2dWithConstraint,MaxNormLinear,MaxNormParametrize) and uses them in EEGNetv4 — they were just omitted here. The dilated TC blocks correctly have no constraint in the source, so leave those unconstrained.2. Dimensionality-reduction width doubled (28 vs 14)
The source DR conv has 14 filters (paper III-C: "the number of filters in the 1×1 convolutional layer … was selected to be 14"; source
Conv2D(14,(1,1))). braindecode doubles it (eegitnet.py:188):This inflates the classifier input (644 vs 322 features) and adds capacity.
Fix
Apply
MaxNormParametrize(1.0)to the 3 inception spatial depthwise convs andMaxNormLinear(max_norm=0.25)(or parametrize) to the final layer; set the DR conv width totcn_in_channel(14). Both are verified against the authors' code. Happy to PR.