spd_learn.models.EEGSPDNet#
- class spd_learn.models.EEGSPDNet(n_chans, n_outputs, n_filters=10, bimap_sizes=(2, 3), filter_time_length=25, final_layer_drop_prob=0, spd_drop_prob=0, spd_drop_scaling=True)[source]#
Bases:
ModuleEE(G) SPDNet.
This class implements the EE(G) SPDNet model [Wilson et al., 2025]. EE(G) SPDNet is designed for EEG signal classification, featuring channel-specific convolution, covariance matrix pooling, and an SPDNet for processing the resulting SPD matrices.
The model consists of the following layers:
A channel-specific convolutional layer that applies a 1D convolution to the input EEG data, using separate filters for each channel.
A sample covariance matrix (SCM) pooling layer that computes SCMs from the convolved signals.
An SPDNet that learns representations from the SPD matrices via a series of BiMap, SPD dropout, and ReEig layers, optionally followed by a LogEig layer.
- Parameters:
n_chans (int) – Number of input EEG channels (electrodes).
n_outputs (int) – Number of output classes for classification.
n_filters (int, default=10) – Number of convolutional filters per channel.
bimap_sizes (tuple, default=(2, 3)) – A tuple defining the scaling factor and number of BiMap layers.
filter_time_length (int, default=25) – Length of the convolutional filter.
final_layer_drop_prob (float, default=0) – Dropout probability applied before the final linear layer.
spd_drop_prob (float, default=0) – Dropout probability used in the SPDNet layers.
spd_drop_scaling (bool, default=True) – Whether to use scaling in the SPD dropout.
- forward(x)[source]#
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.