zoo/resnet/resnet_cifar10_v2_c.py
def projection_block(self, x, n_filters, expand):
        """ Construct a Bottleneck Residual Block of Convolutions with Identity Shortcut
            x        : input into the block
            n_filters: number of filters
            expand   :
        """
        # first group
        if expand == 4:
            strides = (1, 1)
        else:
            strides = (2, 2)

        # Save input vector (feature maps) for the identity link
        shortcut = x
        shortcut = self.Conv2D(shortcut, n_filters * expand, (1, 1), strides=strides, padding='same')
    
        x = self.BatchNormalization(x)
        if expand != 4:
            x = self.ReLU(x)
            x = self.Conv2D(x, n_filters, (1, 1), strides=strides, padding='same')

        x = self.BatchNormalization(x)
        x = self.ReLU(x)
        x = self.Conv2D(x, n_filters, (3, 3), strides=(1, 1), padding='same')
    
        x = self.BatchNormalization(x)
        x = self.ReLU(x)
        x = self.Conv2D(x, n_filters * expand, (1, 1), strides=(1, 1), padding='same')

        # Add the identity link (input) to the output of the residual block
        x = Add()([x, shortcut])
        return x
 Construct a Bottleneck Residual Block of Convolutions with Identity Shortcut
            x        : input into the block
            n_filters: number of filters
            expand   :
        
Construct a Bottleneck Residual Block of Convolutions with Identity Shortcut
x        : input into the block
n_filters: number of filters
expand   .
Construct a Bottleneck Residual Block of Convolutions with Identity Shortcut x : input into the block n_filters : number of filters expand .
def projection_block(self, x, n_filters, expand):
        if expand == 4:
            strides = (1, 1)
        else:
            strides = (2, 2)
        shortcut = x
        shortcut = self.Conv2D(shortcut, n_filters * expand, (1, 1), strides=strides, padding='same')
        x = self.BatchNormalization(x)
        if expand != 4:
            x = self.ReLU(x)
            x = self.Conv2D(x, n_filters, (1, 1), strides=strides, padding='same')
        x = self.BatchNormalization(x)
        x = self.ReLU(x)
        x = self.Conv2D(x, n_filters, (3, 3), strides=(1, 1), padding='same')
        x = self.BatchNormalization(x)
        x = self.ReLU(x)
        x = self.Conv2D(x, n_filters * expand, (1, 1), strides=(1, 1), padding='same')
        x = Add()([x, shortcut])
        return x
def projection_block ( self , x , n_filters , expand ) : if expand == 4 : strides = ( 1 , 1 ) else : strides = ( 2 , 2 ) shortcut = x shortcut = self . Conv2D ( shortcut , n_filters * expand , ( 1 , 1 ) , strides = strides , padding = 'same' ) x = self . BatchNormalization ( x ) if expand != 4 : x = self . ReLU ( x ) x = self . Conv2D ( x , n_filters , ( 1 , 1 ) , strides = strides , padding = 'same' ) x = self . BatchNormalization ( x ) x = self . ReLU ( x ) x = self . Conv2D ( x , n_filters , ( 3 , 3 ) , strides = ( 1 , 1 ) , padding = 'same' ) x = self . BatchNormalization ( x ) x = self . ReLU ( x ) x = self . Conv2D ( x , n_filters * expand , ( 1 , 1 ) , strides = ( 1 , 1 ) , padding = 'same' ) x = Add ( ) ( [ x , shortcut ] ) return x
Construct a Bottleneck Residual Block of Convolutions with Identity Shortcut
x        : input into the block
n_filters: number of filters
expand   :
Construct a Bottleneck Residual Block of Convolutions with Identity Shortcut x : input into the block n_filters : number of filters expand :
""" Construct a Bottleneck Residual Block of Convolutions with Identity Shortcut
            x        : input into the block
            n_filters: number of filters
            expand   :
        """ # first group # Save input vector (feature maps) for the identity link # Add the identity link (input) to the output of the residual block
self
x
n_filters
expand