braindecode.models.TIDNet#

class braindecode.models.TIDNet(in_chans, n_classes, input_window_samples, s_growth=24, t_filters=32, drop_prob=0.4, pooling=15, temp_layers=2, spat_layers=2, temp_span=0.05, bottleneck=3, summary=-1)[source]#

Thinker Invariance DenseNet model from Kostas et al 2020.

See [TIDNet] for details.

Parameters
  • n_classes (int) – Number of classes.

  • in_chans (int) – Number of EEG channels.

  • input_window_samples (int) – Number of samples.

  • s_growth (int) – DenseNet-style growth factor (added filters per DenseFilter)

  • t_filters (int) – Number of temporal filters.

  • drop_prob (float) – Dropout probability

  • pooling (int) – Max temporal pooling (width and stride)

  • temp_layers (int) – Number of temporal layers

  • spat_layers (int) – Number of DenseFilters

  • temp_span (float) – Percentage of input_window_samples that defines the temporal filter length: temp_len = ceil(temp_span * input_window_samples) e.g A value of 0.05 for temp_span with 1500 input_window_samples will yield a temporal filter of length 75.

  • bottleneck (int) – Bottleneck factor within Densefilter

  • summary (int) – Output size of AdaptiveAvgPool1D layer. If set to -1, value will be calculated automatically (input_window_samples // pooling).

Notes

Code adapted from: SPOClab-ca/ThinkerInvariance

References

TIDNet

Kostas, D. & Rudzicz, F. Thinker invariance: enabling deep neural networks for BCI across more people. J. Neural Eng. 17, 056008 (2020). doi: 10.1088/1741-2552/abb7a7.

Methods

forward(x)[source]#

Forward pass.

Parameters

x (torch.Tensor) – Batch of EEG windows of shape (batch_size, n_channels, n_times).