braindecode.augmentation.ChannelsReref#

class braindecode.augmentation.ChannelsReref(probability, random_state=None)[source]#

Randomly re-reference channels in EEG data matrix.

Part of the augmentations proposed in [1]

Parameters:
  • probability (float) – Float setting the probability of applying the operation.

  • 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, to sample which channels to shuffle and to carry the shuffle. Defaults to None.

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 Available from https://proceedings.mlr.press/v136/mohsenvand20a.html.

Methods

get_augmentation_params(*batch)[source]#

Return transform parameters

static operation(y, random_state=None)[source]#

Randomly re-reference channels in EEG data matrix.

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.

  • 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