(use_bn=False,
                     is_training=True,
                     weight_decay=1e-5,
                     batch_norm_decay=0.99,
                     batch_norm_epsilon=1e-5,
                     batch_norm_scale=True)
Defines the default ResNet arg scope.

  TODO(gpapan): The batch-normalization related default values above are
    appropriate for use in conjunction with the reference ResNet models
    released at https://github.com/KaimingHe/deep-residual-networks. When
    training ResNets from scratch, they might need to be tuned.

  Args:
    is_training: Whether or not we are training the parameters in the batch
      normalization layers of the model. (deprecated)
    weight_decay: The weight decay to use for regularizing the model.
    batch_norm_decay: The moving average decay when estimating layer activation
      statistics in batch normalization.
    batch_norm_epsilon: Small constant to prevent division by zero when
      normalizing activations by their variance in batch normalization.
    batch_norm_scale: If True, uses an explicit `gamma` multiplier to scale the
      activations in the batch normalization layer.

  Returns:
    An `arg_scope` to use for the resnet models.
Defines the default ResNet arg scope.
Defines the default ResNet arg scope .
def resnet_arg_scope(use_bn=False,
                     is_training=True,
                     weight_decay=1e-5,
                     batch_norm_decay=0.99,
                     batch_norm_epsilon=1e-5,
                     batch_norm_scale=True):
  """Defines the default ResNet arg scope.

  TODO(gpapan): The batch-normalization related default values above are
    appropriate for use in conjunction with the reference ResNet models
    released at https://github.com/KaimingHe/deep-residual-networks. When
    training ResNets from scratch, they might need to be tuned.

  Args:
    is_training: Whether or not we are training the parameters in the batch
      normalization layers of the model. (deprecated)
    weight_decay: The weight decay to use for regularizing the model.
    batch_norm_decay: The moving average decay when estimating layer activation
      statistics in batch normalization.
    batch_norm_epsilon: Small constant to prevent division by zero when
      normalizing activations by their variance in batch normalization.
    batch_norm_scale: If True, uses an explicit `gamma` multiplier to scale the
      activations in the batch normalization layer.

  Returns:
    An `arg_scope` to use for the resnet models.
  """
  batch_norm_params = {
      'decay':0.9,
      'is_training': is_training,
      'updates_collections':None,
      'zero_debias_moving_mean':True,
  }
  import tensorflow as tf
  with arg_scope(
      [layers_lib.conv2d],
      weights_regularizer=None,
      weights_initializer=tf.truncated_normal_initializer(stddev=0.01),
      activation_fn=nn_ops.relu,
      normalizer_fn=layers.batch_norm if use_bn is True else None):
    with arg_scope([layers.batch_norm], **batch_norm_params):
      # The following implies padding='SAME' for pool1, which makes feature
      # alignment easier for dense prediction tasks. This is also used in
      # https://github.com/facebook/fb.resnet.torch. However the accompanying
      # code of 'Deep Residual Learning for Image Recognition' uses
      # padding='VALID' for pool1. You can switch to that choice by setting
      # tf.contrib.framework.arg_scope([tf.contrib.layers.max_pool2d], padding='VALID').
      with arg_scope([layers.max_pool2d], padding='SAME') as arg_sc:
        return arg_sc
def resnet_arg_scope ( use_bn = False , is_training = True , weight_decay = 1e-5 , batch_norm_decay = 0.99 , batch_norm_epsilon = 1e-5 , batch_norm_scale = True ) : batch_norm_params = { 'decay' : 0.9 , 'is_training' : is_training , 'updates_collections' : None , 'zero_debias_moving_mean' : True , } import tensorflow as tf with arg_scope ( [ layers_lib . conv2d ] , weights_regularizer = None , weights_initializer = tf . truncated_normal_initializer ( stddev = 0.01 ) , activation_fn = nn_ops . relu , normalizer_fn = layers . batch_norm if use_bn is True else None ) : with arg_scope ( [ layers . batch_norm ] , * * batch_norm_params ) : # The following implies padding='SAME' for pool1, which makes feature # alignment easier for dense prediction tasks. This is also used in # https://github.com/facebook/fb.resnet.torch. However the accompanying # code of 'Deep Residual Learning for Image Recognition' uses # padding='VALID' for pool1. You can switch to that choice by setting # tf.contrib.framework.arg_scope([tf.contrib.layers.max_pool2d], padding='VALID'). with arg_scope ( [ layers . max_pool2d ] , padding = 'SAME' ) as arg_sc : return arg_sc