Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cosine decay #184

Merged
merged 3 commits into from
Jun 15, 2020
Merged

add cosine decay #184

merged 3 commits into from
Jun 15, 2020

Conversation

tink2123
Copy link
Collaborator

No description provided.

@@ -41,3 +41,7 @@ Optimizer:
base_lr: 0.0005
beta1: 0.9
beta2: 0.999
decay:
function: cosine_decay
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config.md中可以考虑加decay参数的说明,以及文档中加decay的使用方法,默认有没有使用,能提升多少

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,我更新下文档

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done~ thx

@@ -28,6 +28,16 @@ def AdamDecay(params, parameter_list=None):
base_lr = params['base_lr']
beta1 = params['beta1']
beta2 = params['beta2']
if 'decay' in params:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

配置参数文件里加了decay, 默认是使用decay的是吗?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认不使用,配置文件里添加了才会进行decay

base_lr = fluid.layers.cosine_decay(
learning_rate=base_lr,
step_each_epoch=step_each_epoch,
epochs=total_epoch)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看这里是否要加个提示啥的,如果decay mode不是cosine_decay 采用的是不加decay的优化器

doc里的文档里也可以加一下支持哪些decay方式,可以加在备注里

| function(decay) | 设置decay方式 | cosine_decay | \ |

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decay_list = ["cosine_decay"]
if decay_mode not in decay_list:
print("decay_mode can only be one of {}, but get [{}], the training will running without decay".format(decay_list, decay_mode))

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done,thx

@LDOUBLEV LDOUBLEV merged commit b47b552 into PaddlePaddle:develop Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants