zoo/mobilenet/mobilenet_v1_c.py
def depthwise_block(self, x, strides, **metaparameters):
        """ Construct a Depthwise Separable Convolution block
            x         : input to the block
            strides   : strides
            n_filters : number of filters
            alpha     : width multiplier
        """
        n_filters = metaparameters['n_filters']
        alpha     = metaparameters['alpha']
        del metaparameters['n_filters']
            
        # Apply the width filter to the number of feature maps
        filters = int(n_filters * alpha)

        # Strided convolution to match number of filters
        if strides == (2, 2):
            x = ZeroPadding2D(padding=((0, 1), (0, 1)))(x)
            padding = 'valid'
        else:
            padding = 'same'

        # Depthwise Convolution
        x = self.DepthwiseConv2D(x, (3, 3), strides, padding=padding, **metaparameters)
        x = self.BatchNormalization(x)
        x = self.ReLU(x)

        # Pointwise Convolution
        x = self.Conv2D(x, filters, (1, 1), strides=(1, 1), padding='same', **metaparameters)
        x = self.BatchNormalization(x)
        x = self.ReLU(x)
        return x
 Construct a Depthwise Separable Convolution block
            x         : input to the block
            strides   : strides
            n_filters : number of filters
            alpha     : width multiplier
        
Construct a Depthwise Separable Convolution block
x         : input to the block
strides   : strides
n_filters : number of filters
alpha     : width multiplier
Construct a Depthwise Separable Convolution block x : input to the block strides : strides n_filters : number of filters alpha : width multiplier
def depthwise_block(self, x, strides, **metaparameters):
        n_filters = metaparameters['n_filters']
        alpha     = metaparameters['alpha']
        del metaparameters['n_filters']
        filters = int(n_filters * alpha)
        if strides == (2, 2):
            x = ZeroPadding2D(padding=((0, 1), (0, 1)))(x)
            padding = 'valid'
        else:
            padding = 'same'
        x = self.DepthwiseConv2D(x, (3, 3), strides, padding=padding, **metaparameters)
        x = self.BatchNormalization(x)
        x = self.ReLU(x)
        x = self.Conv2D(x, filters, (1, 1), strides=(1, 1), padding='same', **metaparameters)
        x = self.BatchNormalization(x)
        x = self.ReLU(x)
        return x
def depthwise_block ( self , x , strides , ** metaparameters ) : n_filters = metaparameters [ 'n_filters' ] alpha = metaparameters [ 'alpha' ] del metaparameters [ 'n_filters' ] filters = int ( n_filters * alpha ) if strides == ( 2 , 2 ) : x = ZeroPadding2D ( padding = ( ( 0 , 1 ) , ( 0 , 1 ) ) ) ( x ) padding = 'valid' else : padding = 'same' x = self . DepthwiseConv2D ( x , ( 3 , 3 ) , strides , padding = padding , ** metaparameters ) x = self . BatchNormalization ( x ) x = self . ReLU ( x ) x = self . Conv2D ( x , filters , ( 1 , 1 ) , strides = ( 1 , 1 ) , padding = 'same' , ** metaparameters ) x = self . BatchNormalization ( x ) x = self . ReLU ( x ) return x
Construct a Depthwise Separable Convolution block
x         : input to the block
strides   : strides
n_filters : number of filters
alpha     : width multiplier
Construct a Depthwise Separable Convolution block x : input to the block strides : strides n_filters : number of filters alpha : width multiplier
""" Construct a Depthwise Separable Convolution block
            x         : input to the block
            strides   : strides
            n_filters : number of filters
            alpha     : width multiplier
        """ # Apply the width filter to the number of feature maps # Strided convolution to match number of filters # Depthwise Convolution # Pointwise Convolution
self
x
strides