Class GroupNormLayer

java.lang.Object
smile.deep.layer.ModuleLayer
smile.deep.layer.GroupNormLayer
All Implemented Interfaces:
Function<Tensor,Tensor>, Layer

public class GroupNormLayer extends ModuleLayer
Group normalization. The input channels are separated into groups. The mean and standard-deviation are calculated separately over each group.
  • Constructor Details

    • GroupNormLayer

      public GroupNormLayer(int groups, int channels)
      Constructor.
      Parameters:
      groups - the number of groups to separate the channels into. The number of channels must be divisible by the number of groups.
      channels - the number of input channels in (N,C,H,W).
    • GroupNormLayer

      public GroupNormLayer(int groups, int channels, double eps, boolean affine)
      Constructor.
      Parameters:
      groups - the number of groups to separate the channels into. The number of channels must be divisible by the number of groups.
      channels - the number of input channels in (N,C,H,W).
      eps - a value added to the denominator for numerical stability.
      affine - when set to true, this layer has learnable affine parameters.
  • Method Details

    • forward

      public Tensor forward(Tensor input)
      Description copied from interface: Layer
      Forward propagation (or forward pass) through the layer.
      Parameters:
      input - the input tensor.
      Returns:
      the output tensor.