(is_training=True,
                   weight_decay=0.00004,
                   stddev=0.09,
                   dropout_keep_prob=0.8,
                   bn_decay=0.997)
Defines Mobilenet training scope.

  Usage:
     with tf.contrib.slim.arg_scope(mobilenet.training_scope()):
       logits, endpoints = mobilenet_v2.mobilenet(input_tensor)

     # the network created will be trainble with dropout/batch norm
     # initialized appropriately.
  Args:
    is_training: if set to False this will ensure that all customizations are
    set to non-training mode. This might be helpful for code that is reused
    across both training/evaluation, but most of the time training_scope with
    value False is not needed.

    weight_decay: The weight decay to use for regularizing the model.
    stddev: Standard deviation for initialization, if negative uses xavier.
    dropout_keep_prob: dropout keep probability
    bn_decay: decay for the batch norm moving averages.

  Returns:
    An argument scope to use via arg_scope.
Defines Mobilenet training scope.
Defines Mobilenet training scope .
def training_scope(is_training=True,
                   weight_decay=0.00004,
                   stddev=0.09,
                   dropout_keep_prob=0.8,
                   bn_decay=0.997):
  """Defines Mobilenet training scope.

  Usage:
     with tf.contrib.slim.arg_scope(mobilenet.training_scope()):
       logits, endpoints = mobilenet_v2.mobilenet(input_tensor)

     # the network created will be trainble with dropout/batch norm
     # initialized appropriately.
  Args:
    is_training: if set to False this will ensure that all customizations are
    set to non-training mode. This might be helpful for code that is reused
    across both training/evaluation, but most of the time training_scope with
    value False is not needed.

    weight_decay: The weight decay to use for regularizing the model.
    stddev: Standard deviation for initialization, if negative uses xavier.
    dropout_keep_prob: dropout keep probability
    bn_decay: decay for the batch norm moving averages.

  Returns:
    An argument scope to use via arg_scope.
  """
  # Note: do not introduce parameters that would change the inference
  # model here (for example whether to use bias), modify conv_def instead.
  batch_norm_params = {
      'is_training': is_training,
      'decay': bn_decay,
  }

  if stddev < 0:
    weight_intitializer = slim.initializers.xavier_initializer()
  else:
    weight_intitializer = tf.truncated_normal_initializer(stddev=stddev)

  # Set weight_decay for weights in Conv and FC layers.
  with slim.arg_scope(
      [slim.conv2d, slim.fully_connected, slim.separable_conv2d],
      weights_initializer=weight_intitializer,
      normalizer_fn=slim.batch_norm), \
      slim.arg_scope([mobilenet_base, mobilenet], is_training=is_training),\
      slim.arg_scope([slim.batch_norm], **batch_norm_params), \
      slim.arg_scope([slim.dropout], is_training=is_training,
                     keep_prob=dropout_keep_prob), \
      slim.arg_scope([slim.conv2d], \
                     weights_regularizer=slim.l2_regularizer(weight_decay)), \
      slim.arg_scope([slim.separable_conv2d], weights_regularizer=None) as s:
    return s
def training_scope ( is_training = True , weight_decay = 0.00004 , stddev = 0.09 , dropout_keep_prob = 0.8 , bn_decay = 0.997 ) : # Note: do not introduce parameters that would change the inference # model here (for example whether to use bias), modify conv_def instead. batch_norm_params = { 'is_training' : is_training , 'decay' : bn_decay , } if stddev < 0 : weight_intitializer = slim . initializers . xavier_initializer ( ) else : weight_intitializer = tf . truncated_normal_initializer ( stddev = stddev ) # Set weight_decay for weights in Conv and FC layers. with slim . arg_scope ( [ slim . conv2d , slim . fully_connected , slim . separable_conv2d ] , weights_initializer = weight_intitializer , normalizer_fn = slim . batch_norm ) , slim . arg_scope ( [ mobilenet_base , mobilenet ] , is_training = is_training ) , slim . arg_scope ( [ slim . batch_norm ] , * * batch_norm_params ) , slim . arg_scope ( [ slim . dropout ] , is_training = is_training , keep_prob = dropout_keep_prob ) , slim . arg_scope ( [ slim . conv2d ] , weights_regularizer = slim . l2_regularizer ( weight_decay ) ) , slim . arg_scope ( [ slim . separable_conv2d ] , weights_regularizer = None ) as s : return s