Skip to content

EEGSym spatial convolutions are dense (groups=1, bias=True) instead of depthwise/grouped no-bias #1071

Description

@bruAristimunha

The spatial convolutions in EEGSym (braindecode/models/eegsym.py, _InceptionBlock.spatial_convs and _ResidualBlock.spatial_convs) are dense nn.Conv3d with default bias=True:

nn.Conv3d(
    in_channels=filters_per_branch * len(scales_samples),
    out_channels=filters_per_branch * len(scales_samples),
    kernel_size=(1, 1, ncha),   # spatial conv
    padding=(0, 0, 0),
)   # groups=1 (dense), bias=True

The authors' EEGSym (EEGSym_architecture.py, unit_dconv) uses a depthwise / grouped spatial convolution with no bias — the paper's explicit "grouped convolutions to emulate depthwise" design (§II.D):

Conv3D(kernel_size=(1,1,ncha), filters=filters*len(scales),
       groups=filters*len(scales), use_bias=False)

So braindecode mixes across all filters (dense) instead of per-filter spatial filtering, changes the parameter count, and adds a bias the source omits.

Fix

Build the spatial convs with groups=out_channels (depthwise) and bias=False, matching unit_dconv. (Minor related note: the braindecode default spatial_resnet_repetitions=5 differs from the source default 1 — "set to 1 and not tested".) Happy to PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions