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 2019/03/21 20:01:19 UTC

[GitHub] [incubator-mxnet] piyushghai commented on a change in pull request #14494: [MXNet-1340][Fit API]Adding train history class

piyushghai commented on a change in pull request #14494: [MXNet-1340][Fit API]Adding train history class
URL: https://github.com/apache/incubator-mxnet/pull/14494#discussion_r267933752
 
 

 ##########
 File path: python/mxnet/gluon/trainer.py
 ##########
 @@ -259,6 +259,13 @@ def learning_rate(self):
         else:
             return self._optimizer.learning_rate
 
+    @property
+    def optimizer(self):
+        if isinstance(self._optimizer, opt.Optimizer):
+            return self._optimizer
+        else:
+            raise UserWarning("Optimizer has not been initialized yet")
 
 Review comment:
   What if the user sets a custom optimizer here? 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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