(self, features, M, G, r, stride=1, L=32)
Constructor
        Args:
            features: input channel dimensionality.
            M: the number of branchs.
            G: num of convolution groups.
            r: the radio for compute d, the length of z.
            stride: stride, default 1.
            L: the minimum dim of the vector z in paper, default 32.
Constructor
        Args:
            features: input channel dimensionality.
            M: the number of branchs.
            G: num of convolution groups.
            r: the radio for compute d, the length of z.
            stride: stride, default 1.
            L: the minimum dim of the vector z in paper, default 32.
Constructor Args : features : input channel dimensionality . M : the number of branchs . G : num of convolution groups . r : the radio for compute d the length of z . stride : stride default 1 . L : the minimum dim of the vector z in paper default 32 .
def __init__(self, features, M, G, r, stride=1, L=32):
        """ Constructor
        Args:
            features: input channel dimensionality.
            M: the number of branchs.
            G: num of convolution groups.
            r: the radio for compute d, the length of z.
            stride: stride, default 1.
            L: the minimum dim of the vector z in paper, default 32.
        """
        super(SKConv, self).__init__()
        d = max(int(features / r), L)
        self.convs = nn.ModuleList([])
        for i in range(M):
            self.convs.append(
                nn.Sequential(
                    nn.Conv2d(
                        features,
                        features,
                        kernel_size=1 + i * 2,
                        stride=stride,
                        padding=i,
                        groups=G,
                    ),
                    nn.BatchNorm2d(features),
                    nn.ReLU(inplace=False),
                )
            )
        self.gap = nn.AdaptiveAvgPool2d(1)
        self.fc = nn.Linear(features, d)
        self.fcs = nn.ModuleList([])
        for i in range(M):
            self.fcs.append(nn.Linear(d, features))
        self.softmax = nn.Softmax(dim=1)
def __init__ ( self , features , M , G , r , stride = 1 , L = 32 ) : super ( SKConv , self ) . __init__ ( ) d = max ( int ( features / r ) , L ) self . convs = nn . ModuleList ( [ ] ) for i in range ( M ) : self . convs . append ( nn . Sequential ( nn . Conv2d ( features , features , kernel_size = 1 + i * 2 , stride = stride , padding = i , groups = G , ) , nn . BatchNorm2d ( features ) , nn . ReLU ( inplace = False ) , ) ) self . gap = nn . AdaptiveAvgPool2d ( 1 ) self . fc = nn . Linear ( features , d ) self . fcs = nn . ModuleList ( [ ] ) for i in range ( M ) : self . fcs . append ( nn . Linear ( d , features ) ) self . softmax = nn . Softmax ( dim = 1 )