Skip to content

Add new gard clip [old gradient clip not support in dy graph]#17523

Merged
phlrain merged 16 commits intoPaddlePaddle:developfrom
phlrain:add_new_gard_clip
May 29, 2019
Merged

Add new gard clip [old gradient clip not support in dy graph]#17523
phlrain merged 16 commits intoPaddlePaddle:developfrom
phlrain:add_new_gard_clip

Conversation

@phlrain
Copy link
Collaborator

@phlrain phlrain commented May 21, 2019

old gradient clip not support in dy graph

@phlrain phlrain closed this May 27, 2019
@phlrain phlrain reopened this May 27, 2019
shanyi15
shanyi15 previously approved these changes May 28, 2019
Copy link
Collaborator

@shanyi15 shanyi15 left a comment

Choose a reason for hiding this comment

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

LG

JiabinYang
JiabinYang previously approved these changes May 28, 2019
Copy link
Contributor

@JiabinYang JiabinYang left a comment

Choose a reason for hiding this comment

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

LGTM

no_grad_set=no_grad_set)

if grad_clip is not None and framework.in_dygraph_mode():
params_grads = grad_clip(params_grads)
Copy link
Contributor

Choose a reason for hiding this comment

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

Add Warning to avoid static graph user to have unexpected effect

ClipByNorm = GradientClipByNorm
ClipByGlobalNorm = GradientClipByGlobalNorm


Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add TODO to clarify we will replace original grad_clip with this GradClip

@@ -0,0 +1,254 @@
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to rename this test with Dygraph

chengduoZH
chengduoZH previously approved these changes May 28, 2019
XiaoguangHu01
XiaoguangHu01 previously approved these changes May 28, 2019
@phlrain phlrain requested review from kuke and removed request for kuke May 28, 2019 10:46
@phlrain phlrain merged commit 9f85f21 into PaddlePaddle:develop May 29, 2019
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.

5 participants