Skip to content

EEGNeX bugs #739

Closed
Closed

Description

@martinwimpff

I found a few bugs in the implementation of eegnex:

  1. Activation is missing at two positions (between BN and pooling):

    nn.BatchNorm2d(num_features=self.filter_3),
    nn.AvgPool2d(

    nn.BatchNorm2d(num_features=self.filter_1),
    nn.AvgPool2d(

  2. Maximum norm constraint is missing at two positions:

  1. I am not sure about the activation in line 128, from the paper it should be after line 139.
    self.activation(),
    )
    self.block_2 = nn.Sequential(
    nn.Conv2d(
    in_channels=self.filter_1,
    out_channels=self.filter_2,
    kernel_size=(1, 64),
    padding="same",
    bias=False,
    ),
    nn.BatchNorm2d(num_features=self.filter_2),
    )

    The official code is consitent with braindecode but not with the paper:
    https://github.com/chenxiachan/EEGNeX/blob/044d7fb2a5b953c7004f30fe45db40d1ce57af5c/BenchmarkModels.py#L610-L612

Further suggestions:

  1. These could be integers:

    kernel_block_4: tuple[int, int] = (1, 16),
    dilation_block_4: tuple[int, int] = (1, 2),
    avg_pool_block4: tuple[int, int] = (1, 4),
    kernel_block_5: tuple[int, int] = (1, 16),
    dilation_block_5: tuple[int, int] = (1, 4),
    avg_pool_block5: tuple[int, int] = (1, 8),

  2. This function could be private:

    @staticmethod
    def calc_padding(
    kernel_size: tuple[int, int], dilation: tuple[int, int]
    ) -> tuple[int, int]:

  3. Reduce verbosity by using default values here

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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions