def __init__(self, input_specs=tf.keras.layers.InputSpec(shape=[None, 640, 640, 3]), min_level=3, max_level=7, block_specs=build_block_specs(), endpoints_num_filters=256, resample_alpha=0.5, block_repeats=1, filter_size_scale=1.0, kernel_initializer='VarianceScaling', kernel_regularizer=None, bias_regularizer=None, activation='relu', use_sync_bn=False, norm_momentum=0.99, norm_epsilon=0.001, **kwargs):
    'SpineNet model.'
    self._input_specs = input_specs
    self._min_level = min_level
    self._max_level = max_level
    self._block_specs = block_specs
    self._endpoints_num_filters = endpoints_num_filters
    self._resample_alpha = resample_alpha
    self._block_repeats = block_repeats
    self._filter_size_scale = filter_size_scale
    self._kernel_initializer = kernel_initializer
    self._kernel_regularizer = kernel_regularizer
    self._bias_regularizer = bias_regularizer
    self._activation = activation
    self._use_sync_bn = use_sync_bn
    self._norm_momentum = norm_momentum
    self._norm_epsilon = norm_epsilon
    if (activation == 'relu'):
        self._activation_fn = tf.nn.relu
    elif (activation == 'swish'):
        self._activation_fn = tf.nn.swish
    else:
        raise ValueError('Activation {} not implemented.'.format(activation))
    self._init_block_fn = 'bottleneck'
    self._num_init_blocks = 2
    if use_sync_bn:
        self._norm = layers.experimental.SyncBatchNormalization
    else:
        self._norm = layers.BatchNormalization
    if (tf.keras.backend.image_data_format() == 'channels_last'):
        self._bn_axis = (- 1)
    else:
        self._bn_axis = 1
    inputs = tf.keras.Input(shape=input_specs.shape[1:])
    net = self._build_stem(inputs=inputs)
    net = self._build_scale_permuted_network(net=net, input_width=input_specs.shape[1])
    endpoints = self._build_endpoints(net=net)
    self._output_specs = {l: endpoints[l].get_shape() for l in endpoints}
    super(SpineNet, self).__init__(inputs=inputs, outputs=endpoints)
SpineNet model.
def __init__(self, input_specs=tf.keras.layers.InputSpec(shape=[None, 640, 640, 3]), min_level=3, max_level=7, block_specs=build_block_specs(), endpoints_num_filters=256, resample_alpha=0.5, block_repeats=1, filter_size_scale=1.0, kernel_initializer='VarianceScaling', kernel_regularizer=None, bias_regularizer=None, activation='relu', use_sync_bn=False, norm_momentum=0.99, norm_epsilon=0.001, **kwargs):
    
    self._input_specs = input_specs
    self._min_level = min_level
    self._max_level = max_level
    self._block_specs = block_specs
    self._endpoints_num_filters = endpoints_num_filters
    self._resample_alpha = resample_alpha
    self._block_repeats = block_repeats
    self._filter_size_scale = filter_size_scale
    self._kernel_initializer = kernel_initializer
    self._kernel_regularizer = kernel_regularizer
    self._bias_regularizer = bias_regularizer
    self._activation = activation
    self._use_sync_bn = use_sync_bn
    self._norm_momentum = norm_momentum
    self._norm_epsilon = norm_epsilon
    if (activation == 'relu'):
        self._activation_fn = tf.nn.relu
    elif (activation == 'swish'):
        self._activation_fn = tf.nn.swish
    else:
        raise ValueError('Activation {} not implemented.'.format(activation))
    self._init_block_fn = 'bottleneck'
    self._num_init_blocks = 2
    if use_sync_bn:
        self._norm = layers.experimental.SyncBatchNormalization
    else:
        self._norm = layers.BatchNormalization
    if (tf.keras.backend.image_data_format() == 'channels_last'):
        self._bn_axis = (- 1)
    else:
        self._bn_axis = 1
    inputs = tf.keras.Input(shape=input_specs.shape[1:])
    net = self._build_stem(inputs=inputs)
    net = self._build_scale_permuted_network(net=net, input_width=input_specs.shape[1])
    endpoints = self._build_endpoints(net=net)
    self._output_specs = {l: endpoints[l].get_shape() for l in endpoints}
    super(SpineNet, self).__init__(inputs=inputs, outputs=endpoints)