tf.contrib.slim.arg_scope 完整
缘由 最近一直在看深度学习的代码,又一次看到了slim.arg_scope()的嵌套使用,具体 代码 如下: with slim.arg_scope( [slim.conv2d, slim.separable_conv2d], weights_initializer = tf.truncated_normal_initializer( stddev = weights_initializer_stddev), activation_fn = activation_fn, normalizer_fn =slim.batch_norm if use_batch_norm else None): with slim.arg_scope([slim.batch_norm], ** batch_norm_params): with slim.arg_scope( [slim.conv2d], weights_regularizer = slim.l2_regularizer(weight_decay)): with slim.arg_scope( [slim.separable_conv2d], weights_regularizer = depthwise_regularizer) as arg_sc: return arg_sc 由上述代码可以看到