spd_learn.models.RCEEGNet#

class spd_learn.models.RCEEGNet(n_outputs: int = 2, n_chans: int = 22, n_spatial_filters: int = 22, reduced_dim: int = 8, reg_cov: float = 1e-05, reeig_threshold: float = 1e-12, bimap_dims: Sequence[int] | int | None = None)[source]#

Bases: Module

RCEEGNet.

This class implements the RCEEGNet model [Tibermacine et al., 2025].

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

  • n_outputs (int, default=2) – Number of output classes for classification.

  • n_spatial_filters (int, default=22) – Number of spatial filters learned by the convolutional frontend (dimension D in the paper). Sets the dimension of the initial covariance matrix.

  • reduced_dim (int, default=8) – Target subspace dimension for the BiMap layer (dimension d in the paper, where reduced_dim <= n_spatial_filters).

  • bimap_dims (Sequence[int] or int, optional) – Optional alias for reduced_dim for API consistency across SPDNet-family models.

  • reg_cov (float, default=1e-5) – Diagonal regularization parameter (epsilon in Eq. 8 of the paper) ensuring positive definiteness of the sample covariance matrix.

  • reeig_threshold (float, default=1e-12) – Floor threshold for eigenvalue clamping (epsilon_eig in Section III-E of the paper) for numerical stability before matrix logarithm.

forward(x: Tensor) → Tensor[source]#

Forward pass of the RCEEGNet model.

Parameters:

input (torch.Tensor) – Input tensor of shape (batch_size, n_chans, n_times).

Returns:

Output tensor of shape (batch_size, n_outputs).

Return type:

torch.Tensor

reset_parameters() → None[source]#

Initialize weights according to Section H.a of Tibermacine et al. (2025).