Normalize#

class myoverse.transforms.Normalize(p=2.0, dim='channel', eps=1e-08, **kwargs)[source]#

L-p normalization along a dimension.

Parameters:
  • p (float) – Norm type (1=L1, 2=L2/Euclidean, inf=max).

  • dim (str) – Dimension to normalize over.

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

Examples

>>> x = torch.randn(64, 2048, names=('channel', 'time'))
>>> norm = Normalize(p=2, dim='channel')
>>> y = norm(x)  # L2 normalized along channels

Methods

__init__([p, dim, eps])

_apply(x)

Apply the transform.