diff --git a/python/paddle/framework/io.py b/python/paddle/framework/io.py index 945c8160b47fbdc38ca387e66bc62ceafc3450ae..d794fce5e378dd71088636d7042d02f776a1fa93 100644 --- a/python/paddle/framework/io.py +++ b/python/paddle/framework/io.py @@ -228,7 +228,6 @@ def save(obj, path): emb = paddle.nn.Embedding(10, 10) layer_state_dict = emb.state_dict() paddle.save(layer_state_dict, "emb.pdparams") - scheduler = paddle.optimizer.lr.NoamDecay( d_model=0.01, warmup_steps=100, verbose=True) adam = paddle.optimizer.Adam( @@ -320,7 +319,6 @@ def load(path, **configs): emb = paddle.nn.Embedding(10, 10) layer_state_dict = emb.state_dict() paddle.save(layer_state_dict, "emb.pdparams") - scheduler = paddle.optimizer.lr.NoamDecay( d_model=0.01, warmup_steps=100, verbose=True) adam = paddle.optimizer.Adam( diff --git a/python/paddle/optimizer/lr.py b/python/paddle/optimizer/lr.py index e4fb54c229f212f4dfe1378c8141cc7708b2b04e..2d5dc5d998e638eebf573f6d2c3c584052739629 100644 --- a/python/paddle/optimizer/lr.py +++ b/python/paddle/optimizer/lr.py @@ -1434,7 +1434,8 @@ class CosineAnnealingDecay(LRScheduler): loss.backward() sgd.step() sgd.clear_gradients() - scheduler.step() + scheduler.step() # If you update learning rate each step + # scheduler.step() # If you update learning rate each epoch # train on static graph mode paddle.enable_static() @@ -1460,7 +1461,8 @@ class CosineAnnealingDecay(LRScheduler): 'y': np.random.randn(3, 4, 5).astype('float32') }, fetch_list=loss.name) - scheduler.step() + scheduler.step() # If you update learning rate each step + # scheduler.step() # If you update learning rate each epoch """ def __init__(self,