braindecode.augmentation.functional.mask_encoding#
- braindecode.augmentation.functional.mask_encoding(X, y, time_start, segment_length, n_segments)[source]#
Replaces a contiguous part (or parts) of all channels by zeros (if more than one segment, it may overlap).
Implementation based on [Re49696d5b28b-1]
- Parameters:
- Xtorch.Tensor
EEG input example or batch.
- ytorch.Tensor
EEG labels for the example or batch.
- time_starttorch.Tensor
Tensor of integers containing the position (in last dimension) where to start masking the signal. Should have “n_segments” times the size of the first dimension of X (i.e. “n_segments” start positions per example in the batch).
- segment_length: int
Length of each segment to zero out.
- n_segmentsint
Number of segments to zero out in each example.
- Returns:
- torch.Tensor
Transformed inputs.
- torch.Tensor
Transformed labels.