braindecode.augmentation.functional.cutmix#
- braindecode.augmentation.functional.cutmix(X, y, idx_perm, cut_t_start, cut_t_len)[source]#
Paste a time region of shuffled examples into the original examples.
See [1] for details.
- Parameters:
X (
Tensor) – EEG data in formbatch_size, n_channels, n_timesy (
Tensor) – Target of lengthbatch_sizeidx_perm (
Tensor) – Permuted indices of example that are mixed into original examples.cut_t_start (
Tensor) – Start index of the pasted time region for each example.cut_t_len (
Tensor) – Length of the pasted time region for each example.
- Returns:
X,y. WhereXis augmented andyis a tuple of length 3 containing the labels of the two mixed examples and the fraction of each example kept from the original,1 - cut_t_len / n_times.- Return type:
References
[1]Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, Youngjoon Yoo (2019). CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features. In 2019 IEEE/CVF International Conference on Computer Vision (ICCV) Online: https://arxiv.org/abs/1905.04899