CircularAug
- class selfeeg.augmentation.compose.CircularAug(*augmentations)[source]
Single Augmenter called sequentially from a list, following a circular order.
CircularAugcalls an Augmenter from a given sequence following the order. Augmenters are called circularly. This means that the first call uses the first Augmenter from the input list, the second call will use the second, and so on. When the last Augmenter is called, the class will restart from the first one.To perform an augmentation, simply call the instantiated class (see provided example or check the introductory notebook)
- Parameters:
*augmentations ("callable objects") – The list of augmentations to apply at each call. It can be any callable object, but the first argument to pass must be the element to augment. It is suggested to give a sequence of
StaticSingleAugorDynamicSingleAuginstantiations.
Note
The function will automatically handle RandomAug instances with return_index set to True. In this case, an internal deepcopy with return_index set to false will be automatically created.
- perform_augmentation(X: ArrayLike)[source]
Apply the augmentations with the given arguments and specified order. __call__() will call this method.
Example
>>> import selfeeg.augmentation as aug >>> import torch >>> BatchEEG = torch.zeros(16,32,1024) + torch.sin(torch.linspace(0, 8*np.pi,1024)) >>> Aug_eye = aug.StaticSingleAug( ... aug.add_eeg_artifact,{'Fs': 64, 'artifact': 'eye', 'amplitude': 0.5}) >>> Circular = aug.CircularAug(Aug_eye, aug.identity) >>> EEGeye = Circular(BatchEEG) >>> EEGid = Circular(BatchEEG)