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
wangsen
paddle_dbnet
Commits
15ae5176
Commit
15ae5176
authored
Jun 10, 2020
by
tink2123
Browse files
add cosine decay
parent
ae2589b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
configs/rec/rec_icdar15_train.yml
configs/rec/rec_icdar15_train.yml
+4
-0
ppocr/optimizer.py
ppocr/optimizer.py
+10
-0
No files found.
configs/rec/rec_icdar15_train.yml
View file @
15ae5176
...
@@ -41,3 +41,7 @@ Optimizer:
...
@@ -41,3 +41,7 @@ Optimizer:
base_lr
:
0.0005
base_lr
:
0.0005
beta1
:
0.9
beta1
:
0.9
beta2
:
0.999
beta2
:
0.999
decay
:
function
:
cosine_decay
step_each_epoch
:
20
total_epoch
:
1000
ppocr/optimizer.py
View file @
15ae5176
...
@@ -28,6 +28,16 @@ def AdamDecay(params, parameter_list=None):
...
@@ -28,6 +28,16 @@ def AdamDecay(params, parameter_list=None):
base_lr
=
params
[
'base_lr'
]
base_lr
=
params
[
'base_lr'
]
beta1
=
params
[
'beta1'
]
beta1
=
params
[
'beta1'
]
beta2
=
params
[
'beta2'
]
beta2
=
params
[
'beta2'
]
if
'decay'
in
params
:
params
=
params
[
'decay'
]
decay_mode
=
params
[
'function'
]
step_each_epoch
=
params
[
'step_each_epoch'
]
total_epoch
=
params
[
'total_epoch'
]
if
decay_mode
==
"cosine_decay"
:
base_lr
=
fluid
.
layers
.
cosine_decay
(
learning_rate
=
base_lr
,
step_each_epoch
=
step_each_epoch
,
epochs
=
total_epoch
)
optimizer
=
fluid
.
optimizer
.
Adam
(
optimizer
=
fluid
.
optimizer
.
Adam
(
learning_rate
=
base_lr
,
learning_rate
=
base_lr
,
beta1
=
beta1
,
beta1
=
beta1
,
...
...
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