Makes inception_v3 in tensorflow/tensorflow using the same initializer as tensorflow...
authorA. Unique TensorFlower <gardener@tensorflow.org>
Fri, 15 Dec 2017 23:22:11 +0000 (15:22 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Fri, 15 Dec 2017 23:25:18 +0000 (15:25 -0800)
Experiments show that variance_scaling_initializer, which is used by https://github.com/tensorflow/models/blob/master/research/slim/nets/inception_v3.py#L579 converges faster than truncated_normal_initializer, which is used by https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/slim/python/slim/nets/inception_v3.py

PiperOrigin-RevId: 179247166

tensorflow/contrib/slim/python/slim/nets/inception_v3.py

index e3c0c036d90c95a5f371bef2ca9f960926d82166..432e1f79f12ed5536887738339de845f6343e5ba 100644 (file)
@@ -20,6 +20,7 @@ from __future__ import print_function
 
 from tensorflow.contrib import layers
 from tensorflow.contrib.framework.python.ops import arg_scope
+from tensorflow.contrib.layers.python.layers import initializers
 from tensorflow.contrib.layers.python.layers import layers as layers_lib
 from tensorflow.contrib.layers.python.layers import regularizers
 from tensorflow.python.framework import ops
@@ -675,14 +676,12 @@ def _reduced_kernel_size_for_small_input(input_tensor, kernel_size):
 
 
 def inception_v3_arg_scope(weight_decay=0.00004,
-                           stddev=0.1,
                            batch_norm_var_collection='moving_vars',
                            use_fused_batchnorm=True):
   """Defines the default InceptionV3 arg scope.
 
   Args:
     weight_decay: The weight decay to use for regularizing the model.
-    stddev: The standard deviation of the trunctated normal weight initializer.
     batch_norm_var_collection: The name of the collection for the batch norm
       variables.
     use_fused_batchnorm: Enable fused batchnorm.
@@ -714,8 +713,7 @@ def inception_v3_arg_scope(weight_decay=0.00004,
       weights_regularizer=regularizers.l2_regularizer(weight_decay)):
     with arg_scope(
         [layers.conv2d],
-        weights_initializer=init_ops.truncated_normal_initializer(
-            stddev=stddev),
+        weights_initializer=initializers.variance_scaling_initializer(),
         activation_fn=nn_ops.relu,
         normalizer_fn=layers_lib.batch_norm,
         normalizer_params=batch_norm_params) as sc: