You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/07 00:48:32 UTC

[GitHub] szhengac commented on a change in pull request #10350: Fix Gluon Language Model Example

szhengac commented on a change in pull request #10350: Fix Gluon Language Model Example
URL: https://github.com/apache/incubator-mxnet/pull/10350#discussion_r208069382
 
 

 ##########
 File path: example/gluon/word_language_model/train.py
 ##########
 @@ -188,11 +189,7 @@ def train():
             print('test loss %.2f, test ppl %.2f'%(test_L, math.exp(test_L)))
         else:
             args.lr = args.lr*0.25
-            trainer._init_optimizer('sgd',
-                                    {'learning_rate': args.lr,
-                                     'momentum': 0,
-                                     'wd': 0})
-            model.collect_params().load(args.save, context)
+            trainer.set_learning_rate(args.lr)
 
 Review comment:
   There is evidence that reloading previous saved parameter is better. Keeping the current parameter is instead theoretically supported in the view of optimization.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services