Shortcuts

EEGfuseNet

class torcheeg.models.EEGfuseNet(in_channels: int = 1, num_electrodes: int = 32, hid_channels_gru: int = 16, num_layers_gru: int = 1, hid_channels_cnn: int = 1, chunk_size: int = 384)[source][source]

EEGFuseNet: A hybrid unsupervised network which can fuse high-dimensional EEG to obtain deep feature characterization and generate similar signals. For more details, please refer to the following information.

  • Paper: Z. Liang, R. Zhou, L. Zhang, L. Li, G. Huang, Z. Zhang, and S. Ishii, EEGFuseNet: Hybrid Unsupervised Deep Feature Characterization and Fusion for High-Dimensional EEG With an #Application to Emotion Recognition, IEEE Transactions on Neural Systems and Rehabilitation Engineering, 29, pp. 1913-1925, 2021.

  • URL: https://github.com/KAZABANA/EEGfusenet

import torch

from torcheeg.models.gan.eegfusenet import EEGfuseNet

model = EEGfuseNet(num_electrodes=20,
                   hid_channels_gru=16,
                   num_layers_gru=1,
                   hid_channels_cnn=1,
                   chunk_size=128)
input = torch.rand(2, 1, 20, 128)
output, features = model(output)
Parameters:
  • in_channels (int) – The number of channels of the signal corresponding to each electrode. If the original signal is used as input, in_channels is set to 1; if the original signal is split into multiple sub-bands, in_channels is set to the number of bands. (default: 1)

  • num_electrodes (int) – The number of electordes in input data. (default: 32)

  • hid_channels_gru (int) – The number of hidden nodes in BI-GRU (default: 16)

  • num_layers_gru (int) – The number of layers of BI-GRU. (default: 1)

  • hid_channels_cnn (int) – The number of filters of CNN based encoder. (default: 1)

  • chunk_size (int) – The number of data points included in each EEG chunk.the size of the input EEG signal is( batch size × Channel × Time) (default: 384)

forward(x)[source][source]
Parameters:

x (torch.Tensor) – EEG signal representation, the ideal input shape is [n, 32, 384]. Here, n corresponds to the batch size, 32 corresponds to num_electrodes, and 384 corresponds to chunk_size.

Returns:

The first value is generated EEG signals. The second value is batch of extracted deep features,which used in the unsupervised EEG decoding, can represent the entire input EEG signals cross time points covering not only the EEG characteristics but also the EEG characteristics in the sequential information.

Return type:

torch.Tensor[size of batch, number of electrodes, length of EEG signal],torch.Tensor[size of batch, length of deep feature code]

Read the Docs v: latest
Versions
latest
stable
v1.1.1
v1.1.0
v1.0.11
v1.0.10
v1.0.9
v1.0.8.post1
v1.0.8
v1.0.7
v1.0.6
v1.0.4
v1.0.3
v1.0.2
v1.0.1
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources