Class GroupNormLayer

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

public class GroupNormLayer extends Object implements Layer
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

    • asTorch

      public org.bytedeco.pytorch.Module asTorch()
      Description copied from interface: Layer
      Returns the PyTorch Module object.
      Specified by:
      asTorch in interface Layer
      Returns:
      the PyTorch Module object.
    • forward

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