zoo/resnet/resnet_v2_c.py
def identity_block(self, x, **metaparameters):
        """ Construct a Bottleneck Residual Block with Identity Link
            x        : input into the block
            n_filters: number of filters
        """
        n_filters = metaparameters['n_filters']
        del metaparameters['n_filters']
    
        # Save input vector (feature maps) for the identity link
        shortcut = x
    
        ## Construct the 1x1, 3x3, 1x1 convolution block
    
        # Dimensionality reduction
        x = self.BatchNormalization(x)
        x = self.ReLU(x)
        x = self.Conv2D(x, n_filters, (1, 1), strides=(1, 1), **metaparameters)

        # Bottleneck layer
        x = self.BatchNormalization(x)
        x = self.ReLU(x)
        x = self.Conv2D(x, n_filters, (3, 3), strides=(1, 1), padding="same", **metaparameters)

        # Dimensionality restoration - increase the number of output filters by 4X
        x = self.BatchNormalization(x)
        x = self.ReLU(x)
        x = self.Conv2D(x, n_filters * 4, (1, 1), strides=(1, 1), **metaparameters)

        # Add the identity link (input) to the output of the residual block
        x = Add()([shortcut, x])
        return x
 Construct a Bottleneck Residual Block with Identity Link
            x        : input into the block
            n_filters: number of filters
        
Construct a Bottleneck Residual Block with Identity Link
x        : input into the block
n_filters: number of filters
Construct a Bottleneck Residual Block with Identity Link x : input into the block n_filters : number of filters
def identity_block(self, x, **metaparameters):
        n_filters = metaparameters['n_filters']
        del metaparameters['n_filters']
        shortcut = x
        x = self.BatchNormalization(x)
        x = self.ReLU(x)
        x = self.Conv2D(x, n_filters, (1, 1), strides=(1, 1), **metaparameters)
        x = self.BatchNormalization(x)
        x = self.ReLU(x)
        x = self.Conv2D(x, n_filters, (3, 3), strides=(1, 1), padding="same", **metaparameters)
        x = self.BatchNormalization(x)
        x = self.ReLU(x)
        x = self.Conv2D(x, n_filters * 4, (1, 1), strides=(1, 1), **metaparameters)
        x = Add()([shortcut, x])
        return x
def identity_block ( self , x , ** metaparameters ) : n_filters = metaparameters [ 'n_filters' ] del metaparameters [ 'n_filters' ] shortcut = x x = self . BatchNormalization ( x ) x = self . ReLU ( x ) x = self . Conv2D ( x , n_filters , ( 1 , 1 ) , strides = ( 1 , 1 ) , ** metaparameters ) x = self . BatchNormalization ( x ) x = self . ReLU ( x ) x = self . Conv2D ( x , n_filters , ( 3 , 3 ) , strides = ( 1 , 1 ) , padding = "same" , ** metaparameters ) x = self . BatchNormalization ( x ) x = self . ReLU ( x ) x = self . Conv2D ( x , n_filters * 4 , ( 1 , 1 ) , strides = ( 1 , 1 ) , ** metaparameters ) x = Add ( ) ( [ shortcut , x ] ) return x
Construct a Bottleneck Residual Block with Identity Link
x        : input into the block
n_filters: number of filters
Construct a Bottleneck Residual Block with Identity Link x : input into the block n_filters : number of filters
""" Construct a Bottleneck Residual Block with Identity Link
            x        : input into the block
            n_filters: number of filters
        """ # Save input vector (feature maps) for the identity link ## Construct the 1x1, 3x3, 1x1 convolution block # Dimensionality reduction # Bottleneck layer # Dimensionality restoration - increase the number of output filters by 4X # Add the identity link (input) to the output of the residual block
self
x