gsnn.models.GroupLayerNorm
- class gsnn.models.GroupLayerNorm(*args: Any, **kwargs: Any)[source]
Bases:
ModuleLayer normalization computed separately within each channel group.
- __init__(channel_groups, eps=0.1, affine=True)[source]
- Parameters:
to; (channel_groups tensor specifies which group a channel belongs) – for instance given: [0,0, 1,1, 2,2] specifies 3 groups with 2 channels in each; the first two channels are assigned to group 0.
Methods
__init__(channel_groups[, eps, affine])- param channel_groups tensor specifies which group a channel belongs to;:
for instance given: [0,0, 1,1, 2,2] specifies 3 groups with 2 channels in each;
forward(x)Normalize
xwith shape(B, C, 1)or squeezed(B, C); returns(B, C, 1).