diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-12-15 15:22:11 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-12-15 15:25:18 -0800 |
commit | 117f458ac520fd76efe57b2bc4078ed8ca6b75fc (patch) | |
tree | 7a3b5af8b8004e163b6c2ba1a69c3cd69ad576f4 /tensorflow/contrib/slim | |
parent | a81e83eea823ff1f3e6871eb24f85e7ca09dcf72 (diff) |
Makes inception_v3 in tensorflow/tensorflow using the same initializer as tensorflow/models.
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
Diffstat (limited to 'tensorflow/contrib/slim')
-rw-r--r-- | tensorflow/contrib/slim/python/slim/nets/inception_v3.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tensorflow/contrib/slim/python/slim/nets/inception_v3.py b/tensorflow/contrib/slim/python/slim/nets/inception_v3.py index e3c0c036d9..432e1f79f1 100644 --- a/tensorflow/contrib/slim/python/slim/nets/inception_v3.py +++ b/tensorflow/contrib/slim/python/slim/nets/inception_v3.py @@ -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: |