braindecode.augmentation.functional.amplitude_scale#

braindecode.augmentation.functional.amplitude_scale(X, y, scale, random_state=None)[source]#

Rescale amplitude of each channel based on a random sampled scaling value.

Part of the augmentations proposed in [1]

Parameters:
  • X (Tensor) – EEG input example or batch.

  • y (Tensor) – EEG labels for the example or batch.

  • scale (tuple) – Interval (low, high) from which the per (sample, channel) scaling value is uniformly sampled.

  • random_state (int | RandomState | None) – Seed used to instantiate the numpy random number generator that draws the scaling values. Defaults to None.

Return type:

tuple[Tensor, Tensor]

Returns:

  • torch.Tensor – Transformed inputs.

  • torch.Tensor – Transformed labels.

References

[1]

Mohsenvand, M.N., Izadi, M.R. & Maes, P.. (2020). Contrastive Representation Learning for Electroencephalogram Classification. Proceedings of the Machine Learning for Health NeurIPS Workshop, in Proceedings of Machine Learning Research 136:238-253