braindecode.augmentation.ChannelsSymmetry¶
- class braindecode.augmentation.ChannelsSymmetry(probability, ordered_ch_names, random_state=None)¶
Permute EEG channels inverting left and right-side sensors.
Suggested e.g. in [1]
- Parameters
- probabilityfloat
Float setting the probability of applying the operation.
- ordered_ch_nameslist
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_params(*batch)¶
Return transform parameters.
- Parameters
- Xtensor.Tensor
The data.
- ytensor.Tensor
The labels.
- Returns
- paramsdict
Contains
- permutationfloat
List of integers defining the new channels order.
- static operation(X, y, permutation)¶
Permute EEG channels according to fixed permutation matrix.
Suggested e.g. in [1]
- Parameters
- Xtorch.Tensor
EEG input example or batch.
- ytorch.Tensor
EEG labels for the example or batch.
- permutationlist
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.