You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/08/29 23:24:49 UTC

[GitHub] szha commented on a change in pull request #7659: Gluon trainer updates: add learning_rate and lr_scheduler properties and add setter for learning rate

szha commented on a change in pull request #7659: Gluon trainer updates: add learning_rate and lr_scheduler properties and add setter for learning rate
URL: https://github.com/apache/incubator-mxnet/pull/7659#discussion_r135936859
 
 

 ##########
 File path: python/mxnet/gluon/trainer.py
 ##########
 @@ -113,6 +113,36 @@ def _init_kvstore(self):
 
         self._kv_initialized = True
 
+
+    @property
+    def learning_rate(self):
+        return self._optimizer.lr
 
 Review comment:
   This kind of implementation couples the two classes together (i.e. Trainer must know the structure of optimizer). Instead add accessors in optimizer and make reading learning rate the concern of optimizer.
 
----------------------------------------------------------------
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