InstanceNorm#

class myoverse.transforms.InstanceNorm(eps=1e-05, **kwargs)[source]#

Instance normalization (normalize each sample independently).

Normalizes over channel and time dimensions for each sample. Commonly used in style transfer and generative models.

Parameters:
  • eps (float) – Small value for numerical stability.

  • affine (bool) – Whether to use learnable parameters (requires registration).

Examples

>>> x = torch.randn(32, 64, 200, names=('batch', 'channel', 'time'))
>>> inorm = InstanceNorm()
>>> y = inorm(x)  # Each sample normalized independently

Methods

__init__([eps])

_apply(x)

Apply the transform.