Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
ee832b66
Commit
ee832b66
authored
Aug 02, 2017
by
Marianne Linhares Monteiro
Committed by
GitHub
Aug 02, 2017
Browse files
Adding adjust_learning_rate option
parent
2cc4b2e2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
11 deletions
+22
-11
tutorials/image/cifar10_estimator/cifar10_main.py
tutorials/image/cifar10_estimator/cifar10_main.py
+22
-11
No files found.
tutorials/image/cifar10_estimator/cifar10_main.py
View file @
ee832b66
...
...
@@ -73,23 +73,31 @@ tf.flags.DEFINE_float('momentum', 0.9, 'Momentum for MomentumOptimizer.')
tf
.
flags
.
DEFINE_float
(
'weight_decay'
,
2e-4
,
'Weight decay for convolutions.'
)
tf
.
flags
.
DEFINE_float
(
'adjust_learning_rate'
,
1
,
"""This value will be multiplied by the learning rate.
By default the learning rate is
[0.1, 0.001, 0.0001, 0.00002]
"""
.)
tf
.
flags
.
DEFINE_boolean
(
'use_distortion_for_training'
,
True
,
'If doing image distortion for training.'
)
tf
.
flags
.
DEFINE_boolean
(
'run_experiment'
,
False
,
'If True will run an experiment,'
'otherwise will run training and evaluation'
'using the estimator interface.'
'Experiments perform training on several workers in'
'parallel, in other words experiments know how to'
' invoke train and eval in a sensible fashion for'
' distributed training.'
)
"""If True will run an experiment,
otherwise will run training and evaluation
using the estimator interface.
Experiments perform training on several workers in
parallel, in other words experiments know how to
invoke train and eval in a sensible fashion for
distributed training.
"""
)
tf
.
flags
.
DEFINE_boolean
(
'sync'
,
False
,
'If true when running in a distributed environment'
'will run on sync mode'
)
"""If true when running in a distributed environment
will run on sync mode.
"""
)
tf
.
flags
.
DEFINE_integer
(
'num_workers'
,
1
,
'Number of workers'
)
tf
.
flags
.
DEFINE_integer
(
'num_workers'
,
1
,
'Number of workers
.
'
)
# Perf flags
tf
.
flags
.
DEFINE_integer
(
'num_intra_threads'
,
1
,
...
...
@@ -308,7 +316,10 @@ def _resnet_model_fn(features, labels, mode):
num_batches_per_epoch
*
x
for
x
in
np
.
array
([
82
,
123
,
300
],
dtype
=
np
.
int64
)
]
staged_lr
=
[
0.1
,
0.01
,
0.001
,
0.0002
]
staged_lr
=
[
FLAGS
.
adjust_learning_rate
*
x
for
x
in
[
0.1
,
0.01
,
0.001
,
0.0002
]]
learning_rate
=
tf
.
train
.
piecewise_constant
(
tf
.
train
.
get_global_step
(),
boundaries
,
staged_lr
)
# Create a nicely-named tensor for logging
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment