braindecode.models.EEGResNet#

class braindecode.models.EEGResNet(n_chans=None, n_outputs=None, n_times=None, final_pool_length='auto', n_first_filters=20, n_layers_per_block=2, first_filter_length=3, activation=<class 'torch.nn.modules.activation.ELU'>, split_first_layer=True, batch_norm_alpha=0.1, batch_norm_epsilon=0.0001, conv_weight_init_fn=<function EEGResNet.<lambda>>, chs_info=None, input_window_seconds=None, sfreq=250, in_chans=None, n_classes=None, input_window_samples=None, add_log_softmax=False)[source]#

EEGResNet from Schirrmeister et al. 2017 [Schirrmeister2017].

Model described in [Schirrmeister2017].

Parameters:
  • n_chans (int) – Number of EEG channels.

  • n_outputs (int) – Number of outputs of the model. This is the number of classes in the case of classification.

  • n_times (int) – Number of time samples of the input window.

  • final_pool_length – The description is missing.

  • n_first_filters – The description is missing.

  • n_layers_per_block – The description is missing.

  • first_filter_length – The description is missing.

  • activation (nn.Module, default=nn.ELU) – Activation function class to apply. Should be a PyTorch activation module class like nn.ReLU or nn.ELU. Default is nn.ELU.

  • split_first_layer – The description is missing.

  • batch_norm_alpha – The description is missing.

  • batch_norm_epsilon – The description is missing.

  • conv_weight_init_fn – The description is missing.

  • chs_info (list of dict) – Information about each individual EEG channel. This should be filled with info["chs"]. Refer to mne.Info for more details.

  • input_window_seconds (float) – Length of the input window in seconds.

  • sfreq (float) – Sampling frequency of the EEG recordings.

  • in_chans – Alias for n_chans.

  • n_classes – Alias for n_outputs.

  • input_window_samples – Alias for n_times.

  • add_log_softmax (bool) – Whether to use log-softmax non-linearity as the output function. LogSoftmax final layer will be removed in the future. Please adjust your loss function accordingly (e.g. CrossEntropyLoss)! Check the documentation of the torch.nn loss functions: https://pytorch.org/docs/stable/nn.html#loss-functions.

Raises:
  • ValueError – If some input signal-related parameters are not specified: and can not be inferred.

  • FutureWarning – If add_log_softmax is True, since LogSoftmax final layer: will be removed in the future.

Notes

If some input signal-related parameters are not specified, there will be an attempt to infer them from the other parameters.

References

[Schirrmeister2017] (1,2)

Schirrmeister, R. T., Springenberg, J. T., Fiederer, L. D. J., Glasstetter, M., Eggensperger, K., Tangermann, M., Hutter, F. & Ball, T. (2017). Deep learning with convolutional neural networks for , EEG decoding and visualization. Human Brain Mapping, Aug. 2017. Online: http://dx.doi.org/10.1002/hbm.23730