braindecode.models.BDTCN#
- class braindecode.models.BDTCN(n_chans=None, n_outputs=None, chs_info=None, n_times=None, sfreq=None, input_window_seconds=None, n_blocks=3, n_filters=30, kernel_size=5, drop_prob=0.5, activation: ~torch.nn.modules.module.Module = <class 'torch.nn.modules.activation.ReLU'>)[source]#
Braindecode TCN from Gemein, L et al (2020) [gemein2020].
See [gemein2020] for details.
- Parameters:
n_chans (int) – Number of EEG channels.
n_outputs (int) – Number of outputs of the model. This is the number of classes in the case of classification.
chs_info (list of dict) – Information about each individual EEG channel. This should be filled with
info["chs"]
. Refer tomne.Info
for more details.n_times (int) – Number of time samples of the input window.
sfreq (float) – Sampling frequency of the EEG recordings.
input_window_seconds (float) – Length of the input window in seconds.
n_blocks (int) – number of temporal blocks in the network
n_filters (int) – number of output filters of each convolution
kernel_size (int) – kernel size of the convolutions
drop_prob (float) – dropout probability
activation (nn.Module, default=nn.ReLU) – Activation function class to apply. Should be a PyTorch activation module class like
nn.ReLU
ornn.ELU
. Default isnn.ReLU
.
- Raises:
ValueError – If some input signal-related parameters are not specified: and can not be inferred.
FutureWarning – If add_log_softmax is True, since LogSoftmax final layer: will be removed in the future.
Notes
If some input signal-related parameters are not specified, there will be an attempt to infer them from the other parameters.
References
Methods
- 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
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.- Parameters:
x – The description is missing.