Views
No views yet
Architecture-only repository. Documents thebraindecode.models.Deep4Netclass. No pretrained weights are distributed here. Instantiate the model and train it on your own data.
pip install braindecode1from braindecode.models import Deep4Net
2
3model = Deep4Net(
4 n_chans=22,
5 sfreq=250,
6 input_window_seconds=4.0,
7 n_outputs=4,
8)
| Parameter | Type | Description |
|---|---|---|
| `final_conv_length: int | str` | — |
n_filters_time: int | — | Number of temporal filters. |
n_filters_spat: int | — | Number of spatial filters. |
filter_time_length: int | — | Length of the temporal filter in layer 1. |
pool_time_length: int | — | Length of temporal pooling filter. |
pool_time_stride: int | — | Length of stride between temporal pooling filters. |
n_filters_2: int | — | Number of temporal filters in layer 2. |
filter_length_2: int | — | Length of the temporal filter in layer 2. |
n_filters_3: int | — | Number of temporal filters in layer 3. |
filter_length_3: int | — | Length of the temporal filter in layer 3. |
n_filters_4: int | — | Number of temporal filters in layer 4. |
filter_length_4: int | — | Length of the temporal filter in layer 4. |
activation_first_conv_nonlin: nn.Module, default is nn.ELU | — | Non-linear activation function to be used after convolution in layer 1. |
first_pool_mode: str | — | Pooling mode in layer 1. "max" or "mean". |
first_pool_nonlin: callable | — | Non-linear activation function to be used after pooling in layer 1. |
activation_later_conv_nonlin: nn.Module, default is nn.ELU | — | Non-linear activation function to be used after convolution in later layers. |
later_pool_mode: str | — | Pooling mode in later layers. "max" or "mean". |
later_pool_nonlin: callable | — | Non-linear activation function to be used after pooling in later layers. |
drop_prob: float | — | Dropout probability. |
split_first_layer: bool | — | Split first layer into temporal and spatial layers (True) or just use temporal (False). There would be no non-linearity between the split layers. |
batch_norm: bool | — | Whether to use batch normalisation. |
batch_norm_alpha: float | — | Momentum for BatchNorm2d. |
stride_before_pool: bool | — | Stride before pooling. |
1@article{aristimunha2025braindecode,
2 title = {Braindecode: a deep learning library for raw electrophysiological data},
3 author = {Aristimunha, Bruno and others},
4 journal = {Zenodo},
5 year = {2025},
6 doi = {10.5281/zenodo.17699192},
7}