Shortcuts

Resize

class torcheeg.transforms.Resize(size: Sequence[int] | int, interpolation: str = 'bilinear', apply_to_baseline: bool = False)[source][source]

Use an interpolation algorithm to scale a grid-like EEG signal at the spatial dimension.

from torcheeg import transforms

t = transforms.ToTensor(size=(64, 64))
t(eeg=torch.randn(128, 9, 9))['eeg'].shape
>>> (128, 64, 64)
Parameters:
  • size (tuple) – The output spatial size.

  • interpolation (str) – The interpolation algorithm used for upsampling, can be nearest, linear, bilinear, bicubic, trilinear, and area. (default: 'nearest')

  • apply_to_baseline – (bool): Whether to act on the baseline signal at the same time, if the baseline is passed in when calling. (default: False)

__call__(*args, eeg: Tensor, baseline: Tensor | None = None, **kwargs) Dict[str, Tensor][source][source]
Parameters:
  • eeg (torch.Tensor) – The input EEG signal in shape of [height of grid, width of grid, number of data points].

  • baseline (torch.Tensor, 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 scaled EEG signal at the saptial dimension.

Return type:

torch.Tensor[new height of grid, new width of grid, number of sub-bands]

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