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 (torch.Tensor) – EEG input example or batch.

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

  • scale (tuple of floats) – Interval from which ypu sample the scaling value

  • random_state (int | numpy.random.Generator, optional) – Seed to be used to instantiate numpy random number generator instance. 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