braindecode.augmentation.ChannelsSymmetry#
- class braindecode.augmentation.ChannelsSymmetry(probability, ordered_ch_names, random_state=None)[source]#
Permute EEG channels inverting left and right-side sensors.
Suggested e.g. in [1]
- Parameters:
probability (float) – Float setting the probability of applying the operation.
ordered_ch_names (list) – Ordered list of strings containing the names (in 10-20 nomenclature) of the EEG channels that will be transformed. The first name should correspond the data in the first row of X, the second name in the second row and so on.
random_state (int | numpy.random.Generator, optional) – Seed to be used to instantiate numpy random number generator instance. Used to decide whether or not to transform given the probability argument. Defaults to None.
References
[1]Deiss, O., Biswal, S., Jin, J., Sun, H., Westover, M. B., & Sun, J. (2018). HAMLET: interpretable human and machine co-learning technique. arXiv preprint arXiv:1803.09702.
Methods
- get_augmentation_params(*batch)[source]#
Return transform parameters.
- Parameters:
X (tensor.Tensor) – The data.
y (tensor.Tensor) – The labels.
- Returns:
params – Contains
- permutationfloat
List of integers defining the new channels order.
- Return type:
- static operation(X, y, permutation)[source]#
Permute EEG channels according to fixed permutation matrix.
Suggested e.g. in [1]
- Parameters:
X (torch.Tensor) – EEG input example or batch.
y (torch.Tensor) – EEG labels for the example or batch.
permutation (list) – List of integers defining the new channels order.
- Returns:
torch.Tensor – Transformed inputs.
torch.Tensor – Transformed labels.
References
[1]Deiss, O., Biswal, S., Jin, J., Sun, H., Westover, M. B., & Sun, J. (2018). HAMLET: interpretable human and machine co-learning technique. arXiv preprint arXiv:1803.09702.