def conv2d_bn(x, nb_filter, nb_row, nb_col, border_mode='same', subsample=(1, 1), name=None):
 if (name is not None):
  bn_name = (name + '_bn')
  conv_name = (name + '_conv')
 else:
  bn_name = None
  conv_name = None
 if (K.image_dim_ordering() == 'th'):
  bn_axis = 1
 else:
  bn_axis = 3
 x = Convolution2D(nb_filter, nb_row, nb_col, subsample=subsample, activation='relu', border_mode=border_mode, name=conv_name)(x)
 x = BatchNormalization(axis=bn_axis, name=bn_name)(x)
 return x

def conv2d_bn ( x , nb_filter , nb_row , nb_col , border_mode = 'same' , subsample = ( 1 , 1 ) , name = None ) : if ( name is not None ) : bn_name = ( name + '_bn' ) conv_name = ( name + '_conv' ) else : bn_name = None conv_name = None if ( K . image_dim_ordering ( ) == 'th' ) : bn_axis = 1 else : bn_axis = 3 x = Convolution2D ( nb_filter , nb_row , nb_col , subsample = subsample , activation = 'relu' , border_mode = border_mode , name = conv_name ) ( x ) x = BatchNormalization ( axis = bn_axis , name = bn_name ) ( x ) return x
utility function to apply conv + bn .