braindecode.models.TSception#
- class braindecode.models.TSception(n_chans=None, n_outputs=None, input_window_seconds=None, chs_info=None, n_times=None, sfreq=None, number_filter_temp=9, number_filter_spat=6, hidden_size=128, drop_prob=0.5, activation=<class 'torch.nn.modules.activation.LeakyReLU'>, pool_size=8, inception_windows=(0.5, 0.25, 0.125))[source]#
TSception model from Ding et al. (2020) from [ding2020].
Convolution
TSception: A deep learning framework for emotion detection using EEG.
The model consists of temporal and spatial convolutional layers (Tception and Sception) designed to learn temporal and spatial features from EEG data.
- Parameters:
number_filter_temp (int) – Number of temporal convolutional filters.
number_filter_spat (int) – Number of spatial convolutional filters.
hidden_size (int) – Number of units in the hidden fully connected layer.
drop_prob (float) – Dropout rate applied after the hidden layer.
activation (nn.Module, optional) – Activation function class to apply. Should be a PyTorch activation module like
nn.ReLUornn.LeakyReLU. Default isnn.LeakyReLU.pool_size (int, optional) – Pooling size for the average pooling layers. Default is 8.
inception_windows (list[float], optional) – List of window sizes (in seconds) for the inception modules. Default is [0.5, 0.25, 0.125].
Notes
This implementation is not guaranteed to be correct, has not been checked by original authors. The modifications are minimal and the model is expected to work as intended. the original code from [code2020].
References
[ding2020]Ding, Y., Robinson, N., Zeng, Q., Chen, D., Wai, A. A. P., Lee, T. S., & Guan, C. (2020, July). Tsception: a deep learning framework for emotion detection using EEG. In 2020 international joint conference on neural networks (IJCNN) (pp. 1-7). IEEE.
[code2020]Ding, Y., Robinson, N., Zeng, Q., Chen, D., Wai, A. A. P., Lee, T. S., & Guan, C. (2020, July). Tsception: a deep learning framework for emotion detection using EEG. deepBrains/TSception
Methods
- forward(x)[source]#
Forward pass of the TSception model.
- Parameters:
x (torch.Tensor) – Input tensor of shape (batch_size, n_channels, n_times).
- Returns:
Output tensor of shape (batch_size, n_classes).
- Return type: