braindecode.models.SPARCNet#
- class braindecode.models.SPARCNet(n_chans=None, n_times=None, n_outputs=None, block_layers=4, growth_rate=16, bottleneck_size=16, drop_prob=0.5, conv_bias=True, batch_norm=True, activation=<class 'torch.nn.modules.activation.ELU'>, kernel_size_conv0=7, kernel_size_conv1=1, kernel_size_conv2=3, kernel_size_pool=3, stride_pool=2, stride_conv0=2, stride_conv1=1, stride_conv2=1, padding_pool=1, padding_conv0=3, padding_conv2=1, kernel_size_trans=2, stride_trans=2, chs_info=None, input_window_seconds=None, sfreq=None)[source]#
Seizures, Periodic and Rhythmic pattern Continuum Neural Network (SPaRCNet) from Jing et al. (2023) [jing2023].
Convolution
This is a temporal CNN model for biosignal classification based on the DenseNet architecture.
The model is based on the unofficial implementation [Code2023].
Added in version 0.9.
Notes
This implementation is not guaranteed to be correct, has not been checked by original authors.
- Parameters:
block_layers (int, optional) – Number of layers per dense block. Default is 4.
growth_rate (int, optional) – Growth rate of the DenseNet. Default is 16.
bn_size (int, optional) – Bottleneck size. Default is 16.
drop_prob (float, optional) – Dropout rate. Default is 0.5.
conv_bias (bool, optional) – Whether to use bias in convolutional layers. Default is True.
batch_norm (bool, optional) – Whether to use batch normalization. Default is True.
activation (nn.Module, default=nn.ELU) – Activation function class to apply. Should be a PyTorch activation module class like
nn.ReLUornn.ELU. Default isnn.ELU.
References
[jing2023]Jing, J., Ge, W., Hong, S., Fernandes, M. B., Lin, Z., Yang, C., … & Westover, M. B. (2023). Development of expert-level classification of seizures and rhythmic and periodic patterns during eeg interpretation. Neurology, 100(17), e1750-e1762.
[Code2023]Yang, C., Westover, M.B. and Sun, J., 2023. BIOT Biosignal Transformer for Cross-data Learning in the Wild. GitHub ycq091044/BIOT (accessed 2024-02-13)
Methods
- forward(X)[source]#
Forward pass of the model.
- Parameters:
X (torch.Tensor) – The input tensor of the model with shape (batch_size, n_channels, n_times)
- Returns:
The output tensor of the model with shape (batch_size, n_outputs)
- Return type: