Skip to content

Commit

Permalink
fix dygraph adamw (#36745) (#36794)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyinglia authored Oct 28, 2021
1 parent 0b7f43e commit e3db65d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/paddle/fluid/tests/unittests/test_adamw_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def test_adamw_op_dygraph(self):
lr_ratio=simple_lr_fun)

loss_ref = np.array(
[4.8383293, 3.0854003, 1.33299, -0.418993, -2.171043])
[4.8383293, 3.084947, 1.3323904, -0.41943002, -2.1710064])
for i in range(5):
a1 = linear1(a)
out = linear2(a1)
Expand Down
5 changes: 2 additions & 3 deletions python/paddle/optimizer/adamw.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,8 @@ def _append_optimize_op(self, block, param_and_grad):
moment1, moment2, beta1_pow_acc, beta2_pow_acc, master_weight,
'epsilon', self._epsilon, 'lazy_mode', self._lazy_mode,
'min_row_size_to_use_multithread', 1000, 'beta1', _beta1,
'beta2', _beta2, 'coeff', self._coeff, 'multi_precision',
find_master, 'lr_ratio', lr_ratio_)

'beta2', _beta2, "with_decay", with_decay, 'coeff', self._coeff,
'multi_precision', find_master, 'lr_ratio', lr_ratio_)
return None

inputs = {
Expand Down

0 comments on commit e3db65d

Please sign in to comment.