Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
fc7693ad
Commit
fc7693ad
authored
Apr 03, 2019
by
lukovnikov
Browse files
schedule fix
parent
20686b78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
pytorch_pretrained_bert/optimization.py
pytorch_pretrained_bert/optimization.py
+1
-1
No files found.
pytorch_pretrained_bert/optimization.py
View file @
fc7693ad
...
@@ -54,7 +54,7 @@ class LRSchedule(object):
...
@@ -54,7 +54,7 @@ class LRSchedule(object):
"""
"""
if
self
.
t_total
<
0
:
if
self
.
t_total
<
0
:
return
1.
return
1.
progress
=
step
/
self
.
t_total
progress
=
float
(
step
)
/
self
.
t_total
ret
=
self
.
get_lr_
(
progress
)
ret
=
self
.
get_lr_
(
progress
)
# warning for exceeding t_total (only active with warmup_linear
# warning for exceeding t_total (only active with warmup_linear
if
not
nowarn
and
self
.
warn_t_total
and
progress
>
1.
and
progress
>
self
.
warned_for_t_total_at_progress
:
if
not
nowarn
and
self
.
warn_t_total
and
progress
>
1.
and
progress
>
self
.
warned_for_t_total_at_progress
:
...
...
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