提交 a7744bde 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!1558 fix performance of bert

Merge pull request !1558 from chenhaozhe/bert-optimiaztion
......@@ -180,7 +180,7 @@ class Lamb(Optimizer):
beta2=0.999,
eps=1e-6,
weight_decay=0.0,
decay_filter=lambda x: 'LayerNorm' not in x.name and 'bias' not in x.name):
decay_filter=lambda x: 'layernorm' not in x.name.lower() and 'bias' not in x.name.lower()):
super(Lamb, self).__init__(start_learning_rate, params)
if self.is_group:
......
......@@ -194,8 +194,8 @@ def get_bprop_mul(self):
mul_func = P.Mul()
def bprop(x, y, out, dout):
bc_dx = mul_func(dout, y)
bc_dy = mul_func(dout, x)
bc_dx = mul_func(y, dout)
bc_dy = mul_func(x, dout)
return binop_grad_common(x, y, bc_dx, bc_dy)
return bprop
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册