zoo/shufflenet/shufflenet_c.py
def shuffle_block(self, x, **metaparameters):
        ''' Construct a shuffle Shuffle block  
            x           : input to the block
            n_partitions: number of groups to partition feature maps (channels) into.
            n_filters   : number of filters
            reduction   : dimensionality reduction factor (e.g, 0.25)
            reg         : kernel regularizer
        '''
        n_partitions = metaparameters['n_partitions']
        n_filters    = metaparameters['n_filters']
        reduction    = metaparameters['reduction']
        del metaparameters['n_filters']
        del metaparameters['n_partitions']
            
        # identity shortcut
        shortcut = x
    
        # pointwise group convolution, with dimensionality reduction
        x = self.pw_group_conv(x, n_partitions, int(reduction * n_filters), **metaparameters)
        x = self.ReLU(x)
    
        # channel shuffle layer
        x = self.channel_shuffle(x, n_partitions)
    
        # Depthwise 3x3 Convolution
        x = self.DepthwiseConv2D(x, (3, 3), strides=1, padding='same', **metaparameters)
        x = BatchNormalization()(x)
    
        # pointwise group convolution, with dimensionality restoration
        x = self.pw_group_conv(x, n_partitions, n_filters, **metaparameters)
    
        # Add the identity shortcut (input added to output)
        x = Add()([shortcut, x])
        x = self.ReLU(x)
        return x
 Construct a shuffle Shuffle block  
            x           : input to the block
            n_partitions: number of groups to partition feature maps (channels) into.
            n_filters   : number of filters
            reduction   : dimensionality reduction factor (e.g, 0.25)
            reg         : kernel regularizer
        
Construct a shuffle Shuffle block
x           : input to the block
n_partitions: number of groups to partition feature maps (channels) into.
n_filters   : number of filters
reduction   : dimensionality reduction factor
reg         : kernel regularizer
Construct a shuffle Shuffle block x : input to the block n_partitions : number of groups to partition feature maps ( channels ) into . n_filters : number of filters reduction : dimensionality reduction factor reg : kernel regularizer
def shuffle_block(self, x, **metaparameters):
        n_partitions = metaparameters['n_partitions']
        n_filters    = metaparameters['n_filters']
        reduction    = metaparameters['reduction']
        del metaparameters['n_filters']
        del metaparameters['n_partitions']
        shortcut = x
        x = self.pw_group_conv(x, n_partitions, int(reduction * n_filters), **metaparameters)
        x = self.ReLU(x)
        x = self.channel_shuffle(x, n_partitions)
        x = self.DepthwiseConv2D(x, (3, 3), strides=1, padding='same', **metaparameters)
        x = BatchNormalization()(x)
        x = self.pw_group_conv(x, n_partitions, n_filters, **metaparameters)
        x = Add()([shortcut, x])
        x = self.ReLU(x)
        return x
def shuffle_block ( self , x , ** metaparameters ) : n_partitions = metaparameters [ 'n_partitions' ] n_filters = metaparameters [ 'n_filters' ] reduction = metaparameters [ 'reduction' ] del metaparameters [ 'n_filters' ] del metaparameters [ 'n_partitions' ] shortcut = x x = self . pw_group_conv ( x , n_partitions , int ( reduction * n_filters ) , ** metaparameters ) x = self . ReLU ( x ) x = self . channel_shuffle ( x , n_partitions ) x = self . DepthwiseConv2D ( x , ( 3 , 3 ) , strides = 1 , padding = 'same' , ** metaparameters ) x = BatchNormalization ( ) ( x ) x = self . pw_group_conv ( x , n_partitions , n_filters , ** metaparameters ) x = Add ( ) ( [ shortcut , x ] ) x = self . ReLU ( x ) return x
Construct a shuffle Shuffle block
x           : input to the block
n_partitions: number of groups to partition feature maps (channels) into.
Construct a shuffle Shuffle block x : input to the block n_partitions : number of groups to partition feature maps ( channels ) into .
''' Construct a shuffle Shuffle block  
            x           : input to the block
            n_partitions: number of groups to partition feature maps (channels) into.
            n_filters   : number of filters
            reduction   : dimensionality reduction factor (e.g, 0.25)
            reg         : kernel regularizer
        ''' # identity shortcut # pointwise group convolution, with dimensionality reduction # channel shuffle layer # Depthwise 3x3 Convolution # pointwise group convolution, with dimensionality restoration # Add the identity shortcut (input added to output)
self
x