sleepless.models.chambon2018#

Classes

SleepStagerChambon2018(n_channels, sfreq[, ...])

Sleep staging architecture from [Chambon-2018].

class sleepless.models.chambon2018.SleepStagerChambon2018(n_channels, sfreq, n_conv_chs=8, time_conv_size_s=0.5, max_pool_size_s=0.125, n_classes=5, input_size_s=30, dropout=0.25)[source]#

Bases: Module

Sleep staging architecture from [Chambon-2018].

This class was copied with minor modifications from https://github.com/braindecode/braindecode/blob/master/braindecode/models/sleep_stager_chambon_2018.py v0.7.0

Modification: remove condition to return features extracted before classification,now there are always returned

Convolutional neural network for sleep staging described in [Chambon-2018].

Parameters:
  • n_channels (int) – Number of EEG channels.

  • sfreq (float) – EEG sampling frequency.

  • n_conv_chs (int) – Number of convolutional channels. Set to 8 in [Chambon-2018].

  • time_conv_size_s (float) – Size of filters in temporal convolution layers, in seconds. Set to 0.5 in [Chambon-2018] (64 samples at sfreq=128).

  • max_pool_size_s (float) – Max pooling size, in seconds. Set to 0.125 in [Chambon-2018] (16 samples at sfreq=128).

  • n_classes (int) – Number of classes.

  • input_size_s (float) – Size of the input, in seconds.

  • dropout (float) – Dropout rate before the output dense layer.

References

forward(x)[source]#

Forward pass.

Parameters:

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