Shortcuts

To2d

class torcheeg.transforms.To2d(apply_to_baseline: bool = False)[source][source]

Taking the electrode index as the row index and the temporal index as the column index, a two-dimensional EEG signal representation with the size of [number of electrodes, number of data points] is formed. While PyTorch performs convolution on the 2d tensor, an additional channel dimension is required, thus we append an additional dimension.

transform = To2d()
transform(eeg=np.random.randn(32, 128))['eeg'].shape
>>> (1, 32, 128)
__call__(*args, eeg: ndarray, baseline: ndarray | None = None, **kwargs) Dict[str, ndarray][source][source]
Parameters:
  • eeg (np.ndarray) – The input EEG signals in shape of [number of electrodes, number of data points].

  • baseline (np.ndarray, optional) – The corresponding baseline signal, if apply_to_baseline is set to True and baseline is passed, the baseline signal will be transformed with the same way as the experimental signal.

Returns:

The transformed results with the shape of [1, number of electrodes, number of data points].

Return type:

np.ndarray

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