ZScore#

class myoverse.transforms.ZScore(dim='time', eps=1e-08, keepdim=True, **kwargs)[source]#

Z-score normalization (mean=0, std=1) along a dimension.

Parameters:
  • dim (str) – Dimension to normalize over.

  • eps (float) – Small value to avoid division by zero.

  • keepdim (bool) – Whether to keep the dimension in mean/std computation.

Examples

>>> x = torch.randn(64, 2048, device='cuda', names=('channel', 'time'))
>>> zscore = ZScore(dim='time')
>>> y = zscore(x)  # Normalized to mean=0, std=1 per channel

Methods

__init__([dim, eps, keepdim])

_apply(x)

Apply the transform.