Skip to content

Commit e3db65d

Browse files
authored
fix dygraph adamw (#36745) (#36794)
1 parent 0b7f43e commit e3db65d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

python/paddle/fluid/tests/unittests/test_adamw_op.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def test_adamw_op_dygraph(self):
333333
lr_ratio=simple_lr_fun)
334334

335335
loss_ref = np.array(
336-
[4.8383293, 3.0854003, 1.33299, -0.418993, -2.171043])
336+
[4.8383293, 3.084947, 1.3323904, -0.41943002, -2.1710064])
337337
for i in range(5):
338338
a1 = linear1(a)
339339
out = linear2(a1)

python/paddle/optimizer/adamw.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,8 @@ def _append_optimize_op(self, block, param_and_grad):
304304
moment1, moment2, beta1_pow_acc, beta2_pow_acc, master_weight,
305305
'epsilon', self._epsilon, 'lazy_mode', self._lazy_mode,
306306
'min_row_size_to_use_multithread', 1000, 'beta1', _beta1,
307-
'beta2', _beta2, 'coeff', self._coeff, 'multi_precision',
308-
find_master, 'lr_ratio', lr_ratio_)
309-
307+
'beta2', _beta2, "with_decay", with_decay, 'coeff', self._coeff,
308+
'multi_precision', find_master, 'lr_ratio', lr_ratio_)
310309
return None
311310

312311
inputs = {

0 commit comments

Comments
 (0)