aten_model.py
def atrous_conv_block_share(input_tensor_list, kernel_size, filters, stage, 
                     block, strides=(1, 1), atrous_rate=(2, 2), use_bias=True):
    '''conv_block is the block that has a conv layer at shortcut
    # Arguments
        kernel_size: defualt 3, the kernel size of middle conv layer at main path
        filters: list of integers, the nb_filters of 3 conv layer at main path
        stage: integer, current stage label, used for generating layer names
        block: 'a','b'..., current block label, used for generating layer names
    '''
    nb_filter1, nb_filter2, nb_filter3 = filters
    conv_name_base = 'res' + str(stage) + block + '_branch'
    bn_name_base = 'bn' + str(stage) + block + '_branch'

    conv1 = KL.Conv2D(nb_filter1, (1, 1), strides=strides, 
                  name=conv_name_base + '2a', use_bias=use_bias)
    bn1 = BatchNorm(axis=-1, name=bn_name_base + '2a')

    conv2 = KL.Conv2D(nb_filter2, (kernel_size, kernel_size), padding='same', dilation_rate=atrous_rate, 
                  name=conv_name_base + '2b', use_bias=use_bias)
    bn2 = BatchNorm(axis=-1, name=bn_name_base + '2b')

    conv3 = KL.Conv2D(nb_filter3, (1, 1), name=conv_name_base + '2c',  
                  use_bias=use_bias)
    bn3 = BatchNorm(axis=-1, name=bn_name_base + '2c')

    conv4 = KL.Conv2D(nb_filter3, (1, 1), strides=strides,  
                        name=conv_name_base + '1', use_bias=use_bias)
    bn4 = BatchNorm(axis=-1, name=bn_name_base + '1')


    features = []
    for input_tensor in input_tensor_list:

        x = conv1(input_tensor)
        x = bn1(x)
        x = KL.Activation('relu')(x)

        x = conv2(x)
        x = bn2(x)
        x = KL.Activation('relu')(x)

        x = conv3(x)
        x = bn3(x)

        shortcut = conv4(input_tensor)
        shortcut = bn4(shortcut)

        x = KL.Add()([x, shortcut])
        x = KL.Activation('relu')(x)
        features.append(x)
    return features
conv_block is the block that has a conv layer at shortcut
    # Arguments
        kernel_size: defualt 3, the kernel size of middle conv layer at main path
        filters: list of integers, the nb_filters of 3 conv layer at main path
        stage: integer, current stage label, used for generating layer names
        block: 'a','b'..., current block label, used for generating layer names
    
conv_block is the block that has a conv layer at shortcut
Arguments
kernel_size: defualt 3, the kernel size of middle conv layer at main path
filters: list of integers, the nb_filters of 3 conv layer at main path
stage: integer, current stage label, used for generating layer names
block: 'a','b'..., current block label, used for generating layer names
conv_block is the block that has a conv layer at shortcut Arguments kernel_size : defualt 3 the kernel size of middle conv layer at main path filters : list of integers the nb_filters of 3 conv layer at main path stage : integer current stage label used for generating layer names block : ' a ' ' b ' ... current block label used for generating layer names
def atrous_conv_block_share(input_tensor_list, kernel_size, filters, stage, 
                     block, strides=(1, 1), atrous_rate=(2, 2), use_bias=True):
    nb_filter1, nb_filter2, nb_filter3 = filters
    conv_name_base = 'res' + str(stage) + block + '_branch'
    bn_name_base = 'bn' + str(stage) + block + '_branch'
    conv1 = KL.Conv2D(nb_filter1, (1, 1), strides=strides, 
                  name=conv_name_base + '2a', use_bias=use_bias)
    bn1 = BatchNorm(axis=-1, name=bn_name_base + '2a')
    conv2 = KL.Conv2D(nb_filter2, (kernel_size, kernel_size), padding='same', dilation_rate=atrous_rate, 
                  name=conv_name_base + '2b', use_bias=use_bias)
    bn2 = BatchNorm(axis=-1, name=bn_name_base + '2b')
    conv3 = KL.Conv2D(nb_filter3, (1, 1), name=conv_name_base + '2c',  
                  use_bias=use_bias)
    bn3 = BatchNorm(axis=-1, name=bn_name_base + '2c')
    conv4 = KL.Conv2D(nb_filter3, (1, 1), strides=strides,  
                        name=conv_name_base + '1', use_bias=use_bias)
    bn4 = BatchNorm(axis=-1, name=bn_name_base + '1')
    features = []
    for input_tensor in input_tensor_list:
        x = conv1(input_tensor)
        x = bn1(x)
        x = KL.Activation('relu')(x)
        x = conv2(x)
        x = bn2(x)
        x = KL.Activation('relu')(x)
        x = conv3(x)
        x = bn3(x)
        shortcut = conv4(input_tensor)
        shortcut = bn4(shortcut)
        x = KL.Add()([x, shortcut])
        x = KL.Activation('relu')(x)
        features.append(x)
    return features
def atrous_conv_block_share ( input_tensor_list , kernel_size , filters , stage , block , strides = ( 1 , 1 ) , atrous_rate = ( 2 , 2 ) , use_bias = True ) : nb_filter1 , nb_filter2 , nb_filter3 = filters conv_name_base = 'res' + str ( stage ) + block + '_branch' bn_name_base = 'bn' + str ( stage ) + block + '_branch' conv1 = KL . Conv2D ( nb_filter1 , ( 1 , 1 ) , strides = strides , name = conv_name_base + '2a' , use_bias = use_bias ) bn1 = BatchNorm ( axis = - 1 , name = bn_name_base + '2a' ) conv2 = KL . Conv2D ( nb_filter2 , ( kernel_size , kernel_size ) , padding = 'same' , dilation_rate = atrous_rate , name = conv_name_base + '2b' , use_bias = use_bias ) bn2 = BatchNorm ( axis = - 1 , name = bn_name_base + '2b' ) conv3 = KL . Conv2D ( nb_filter3 , ( 1 , 1 ) , name = conv_name_base + '2c' , use_bias = use_bias ) bn3 = BatchNorm ( axis = - 1 , name = bn_name_base + '2c' ) conv4 = KL . Conv2D ( nb_filter3 , ( 1 , 1 ) , strides = strides , name = conv_name_base + '1' , use_bias = use_bias ) bn4 = BatchNorm ( axis = - 1 , name = bn_name_base + '1' ) features = [ ] for input_tensor in input_tensor_list : x = conv1 ( input_tensor ) x = bn1 ( x ) x = KL . Activation ( 'relu' ) ( x ) x = conv2 ( x ) x = bn2 ( x ) x = KL . Activation ( 'relu' ) ( x ) x = conv3 ( x ) x = bn3 ( x ) shortcut = conv4 ( input_tensor ) shortcut = bn4 ( shortcut ) x = KL . Add ( ) ( [ x , shortcut ] ) x = KL . Activation ( 'relu' ) ( x ) features . append ( x ) return features
conv_block is the block that has a conv layer at shortcut
 Arguments
kernel_size: defualt 3, the kernel size of middle conv layer at main path
filters: list of integers, the nb_filters of 3 conv layer at main path
stage: integer, current stage label, used for generating layer names
block: 'a','b'..., current block label, used for generating layer names
conv_block is the block that has a conv layer at shortcut Arguments kernel_size : defualt 3 the kernel size of middle conv layer at main path filters : list of integers the nb_filters of 3 conv layer at main path stage : integer current stage label used for generating layer names block : ' a ' ' b ' ... current block label used for generating layer names
'''conv_block is the block that has a conv layer at shortcut
    # Arguments
        kernel_size: defualt 3, the kernel size of middle conv layer at main path
        filters: list of integers, the nb_filters of 3 conv layer at main path
        stage: integer, current stage label, used for generating layer names
        block: 'a','b'..., current block label, used for generating layer names
    '''
input_tensor_list
kernel_size
filters
stage
block
strides
atrous_rate
use_bias