TimeWarp#

class myoverse.transforms.TimeWarp(sigma=0.2, n_knots=4, p=1.0, dim='time', **kwargs)[source]#

Warp time axis with smooth random curves.

Creates smooth random time shifts using cubic interpolation.

Parameters:
  • sigma (float) – Standard deviation for the warping curves.

  • n_knots (int) – Number of control points.

  • p (float) – Probability of applying the augmentation.

  • dim (str) – Time dimension to warp.

Examples

>>> x = torch.randn(64, 2048, device='cuda', names=('channel', 'time'))
>>> warp = TimeWarp(sigma=0.2, n_knots=4)
>>> y = warp(x)

Methods

__init__([sigma, n_knots, p, dim])

_apply(x)

Apply the transform.