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
OpenDAS
apex
Commits
59bf7d13
Commit
59bf7d13
authored
Aug 20, 2018
by
Michael Carilli
Browse files
minor cleanup
parent
17971202
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
examples/imagenet/main.py
examples/imagenet/main.py
+5
-5
examples/imagenet/main_fp16_optimizer.py
examples/imagenet/main_fp16_optimizer.py
+5
-5
No files found.
examples/imagenet/main.py
View file @
59bf7d13
...
...
@@ -436,12 +436,12 @@ def adjust_learning_rate(optimizer, epoch, step, len_epoch):
lr
=
args
.
lr
*
(
0.1
**
factor
)
"""Warmup"""
if
epoch
<
5
:
lr
=
lr
*
float
(
step
+
epoch
*
len_epoch
)
/
(
5.
*
len_epoch
)
"""Warmup"""
if
epoch
<
5
:
lr
=
lr
*
float
(
1
+
step
+
epoch
*
len_epoch
)
/
(
5.
*
len_epoch
)
if
(
args
.
local_rank
==
0
):
print
(
"epoch = {}, step = {}, lr = {}"
.
format
(
epoch
,
step
,
lr
))
#
if(args.local_rank == 0):
#
print("epoch = {}, step = {}, lr = {}".format(epoch, step, lr))
for
param_group
in
optimizer
.
param_groups
:
param_group
[
'lr'
]
=
lr
...
...
examples/imagenet/main_fp16_optimizer.py
View file @
59bf7d13
...
...
@@ -433,12 +433,12 @@ def adjust_learning_rate(optimizer, epoch, step, len_epoch):
lr
=
args
.
lr
*
(
0.1
**
factor
)
"""Warmup"""
if
epoch
<
5
:
lr
=
lr
*
float
(
step
+
epoch
*
len_epoch
)
/
(
5.
*
len_epoch
)
"""Warmup"""
if
epoch
<
5
:
lr
=
lr
*
float
(
1
+
step
+
epoch
*
len_epoch
)
/
(
5.
*
len_epoch
)
if
(
args
.
local_rank
==
0
):
print
(
"epoch = {}, step = {}, lr = {}"
.
format
(
epoch
,
step
,
lr
))
#
if(args.local_rank == 0):
#
print("epoch = {}, step = {}, lr = {}".format(epoch, step, lr))
for
param_group
in
optimizer
.
param_groups
:
param_group
[
'lr'
]
=
lr
...
...
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