flip_horizontal

selfeeg.augmentation.functional.flip_horizontal(x: ArrayLike) ArrayLike[source]

flips the elements of the ArrayLike object along its last dimension.

Parameters:

x (ArrayLike) – The input Tensor or Array.

Returns:

x (ArrayLike) – The augmented version of the input Tensor or Array.

Example

>>> import torch
>>> import selfeeg.augmentation as aug
>>> x = torch.zeros(16,32,1024) + torch.sin(torch.linspace(0, 8*torch.pi,1024))
>>> xaug = aug.flip_horizontal(x)
>>> print(torch.equal(xaug, torch.flip(x, [len(x.shape)-1]))) #should return True