Cutout#

class myoverse.transforms.Cutout(n_holes=1, length=50, p=0.5, dim='time', **kwargs)[source]#

Randomly zero out contiguous regions.

Parameters:
  • n_holes (int) – Number of regions to cut out.

  • length (int | float) – Length of each cutout. If float < 1, fraction of total length.

  • p (float) – Probability of applying cutout.

  • dim (str) – Dimension to cut along.

Examples

>>> x = torch.randn(64, 2048, device='cuda', names=('channel', 'time'))
>>> cutout = Cutout(n_holes=3, length=50)
>>> y = cutout(x)

Methods

__init__([n_holes, length, p, dim])

_apply(x)

Apply the transform.