braindecode.augmentation.GaussianNoise¶
- class braindecode.augmentation.GaussianNoise(probability, std=0.1, random_state=None)¶
Randomly add white noise to all channels.
Suggested e.g. in [1], [2] and [3]
- Parameters
- probabilityfloat
Float setting the probability of applying the operation.
- stdfloat, optional
Standard deviation to use for the additive noise. Defaults to 0.1.
- random_state: int | numpy.random.Generator, optional
Seed to be used to instantiate numpy random number generator instance. Defaults to None.
References
- 1
Wang, F., Zhong, S. H., Peng, J., Jiang, J., & Liu, Y. (2018). Data augmentation for eeg-based emotion recognition with deep convolutional neural networks. In International Conference on Multimedia Modeling (pp. 82-93).
- 2
Cheng, J. Y., Goh, H., Dogrusoz, K., Tuzel, O., & Azemi, E. (2020). Subject-aware contrastive learning for biosignals. arXiv preprint arXiv:2007.04871.
- 3
Mohsenvand, M. N., Izadi, M. R., & Maes, P. (2020). Contrastive Representation Learning for Electroencephalogram Classification. In Machine Learning for Health (pp. 238-253). PMLR.
Methods
- get_params(*batch)¶
Return transform parameters.
- Parameters
- Xtensor.Tensor
The data.
- ytensor.Tensor
The labels.
- Returns
- paramsdict
Contains
- stdfloat
Standard deviation to use for the additive noise.
- random_statenumpy.random.Generator
The generator to use.
- static operation(X, y, std, random_state=None)¶
Randomly add white Gaussian noise to all channels.
Suggested e.g. in [1], [2] and [3]
- Parameters
- Xtorch.Tensor
EEG input example or batch.
- ytorch.Tensor
EEG labels for the example or batch.
- stdfloat
Standard deviation to use for the additive noise.
- random_state: int | numpy.random.Generator, optional
Seed to be used to instantiate numpy random number generator instance. Defaults to None.
- Returns
- torch.Tensor
Transformed inputs.
- torch.Tensor
Transformed labels.
References
- 1
Wang, F., Zhong, S. H., Peng, J., Jiang, J., & Liu, Y. (2018). Data augmentation for eeg-based emotion recognition with deep convolutional neural networks. In International Conference on Multimedia Modeling (pp. 82-93).
- 2
Cheng, J. Y., Goh, H., Dogrusoz, K., Tuzel, O., & Azemi, E. (2020). Subject-aware contrastive learning for biosignals. arXiv preprint arXiv:2007.04871.
- 3
Mohsenvand, M. N., Izadi, M. R., & Maes, P. (2020). Contrastive Representation Learning for Electroencephalogram Classification. In Machine Learning for Health (pp. 238-253). PMLR.