{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-mxnet/pulls/comments/135947929","pull_request_review_id":59421313,"id":135947929,"diff_hunk":"@@ -113,6 +119,34 @@ def _init_kvstore(self):\n \n         self._kv_initialized = True\n \n+\n+    @property\n+    def learning_rate(self):\n+        if not isinstance(self._optimizer, opt.Optimizer):\n+            raise UserWarning(\"Optimizer has to be defined before its learning\"\n+                              \"rate can be accessed.\")\n+        else:\n+            return self._optimizer.learning_rate\n+\n+\n+    def set_learning_rate(self, lr):\n+        \"\"\"Mutate the learning rate.\n+\n+        Mutate the learning rate of the optimizer only if the LRScheduler of\n+        the optimizer is undefined.\n+\n+        Parameters\n+        ----------\n+        lr : float\n+            The new learning rate of the optimizer.\n+        \"\"\"\n+        if not isinstance(self._optimizer, opt.Optimizer):\n+            raise UserWarning(\"Optimizer has to be defined before its learning\"\n+                              \"rate is mutated.\")\n+        else:\n+            self._optimizer.set_learning_rate(lr)","path":"python/mxnet/gluon/trainer.py","position":42,"original_position":42,"commit_id":"cfef07bf1a0af27e195a596596385ddc699e398d","original_commit_id":"cfef07bf1a0af27e195a596596385ddc699e398d","user":{"login":"szha","id":2626883,"avatar_url":"https://avatars2.githubusercontent.com/u/2626883?v=4","gravatar_id":"","url":"https://api.github.com/users/szha","html_url":"https://github.com/szha","followers_url":"https://api.github.com/users/szha/followers","following_url":"https://api.github.com/users/szha/following{/other_user}","gists_url":"https://api.github.com/users/szha/gists{/gist_id}","starred_url":"https://api.github.com/users/szha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szha/subscriptions","organizations_url":"https://api.github.com/users/szha/orgs","repos_url":"https://api.github.com/users/szha/repos","events_url":"https://api.github.com/users/szha/events{/privacy}","received_events_url":"https://api.github.com/users/szha/received_events","type":"User","site_admin":false},"body":"Update according to the comment below","created_at":"2017-08-30T00:52:17Z","updated_at":"2017-08-30T00:52:17Z","html_url":"https://github.com/apache/incubator-mxnet/pull/7659#discussion_r135947929","pull_request_url":"https://api.github.com/repos/apache/incubator-mxnet/pulls/7659","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-mxnet/pulls/comments/135947929"},"html":{"href":"https://github.com/apache/incubator-mxnet/pull/7659#discussion_r135947929"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-mxnet/pulls/7659"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-mxnet/pulls/7659","id":138297401,"html_url":"https://github.com/apache/incubator-mxnet/pull/7659","diff_url":"https://github.com/apache/incubator-mxnet/pull/7659.diff","patch_url":"https://github.com/apache/incubator-mxnet/pull/7659.patch","issue_url":"https://api.github.com/repos/apache/incubator-mxnet/issues/7659","number":7659,"state":"open","locked":false,"title":"Gluon trainer updates: add learning_rate and lr_scheduler properties and add setter for learning rate","user":{"login":"astonzhang","id":22279212,"avatar_url":"https://avatars1.githubusercontent.com/u/22279212?v=4","gravatar_id":"","url":"https://api.github.com/users/astonzhang","html_url":"https://github.com/astonzhang","followers_url":"https://api.github.com/users/astonzhang/followers","following_url":"https://api.github.com/users/astonzhang/following{/other_user}","gists_url":"https://api.github.com/users/astonzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/astonzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astonzhang/subscriptions","organizations_url":"https://api.github.com/users/astonzhang/orgs","repos_url":"https://api.github.com/users/astonzhang/repos","events_url":"https://api.github.com/users/astonzhang/events{/privacy}","received_events_url":"https://api.github.com/users/astonzhang/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-08-29T22:20:42Z","updated_at":"2017-08-30T00:52:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"613cbb92a69a142104c9d63015e0692388fba9a6","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-mxnet/pulls/7659/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-mxnet/pulls/7659/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-mxnet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-mxnet/issues/7659/comments","statuses_url":"https://api.github.com/repos/apache/incubator-mxnet/statuses/cfef07bf1a0af27e195a596596385ddc699e398d","head":{"label":"astonzhang:master","ref":"master","sha":"cfef07bf1a0af27e195a596596385ddc699e398d","user":{"login":"astonzhang","id":22279212,"avatar_url":"https://avatars1.githubusercontent.com/u/22279212?v=4","gravatar_id":"","url":"https://api.github.com/users/astonzhang","html_url":"https://github.com/astonzhang","followers_url":"https://api.github.com/users/astonzhang/followers","following_url":"https://api.github.com/users/astonzhang/following{/other_user}","gists_url":"https://api.github.com/users/astonzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/astonzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astonzhang/subscriptions","organizations_url":"https://api.github.com/users/astonzhang/orgs","repos_url":"https://api.github.com/users/astonzhang/repos","events_url":"https://api.github.com/users/astonzhang/events{/privacy}","received_events_url":"https://api.github.com/users/astonzhang/received_events","type":"User","site_admin":false},"repo":{"id":85788487,"name":"mxnet","full_name":"astonzhang/mxnet","owner":{"login":"astonzhang","id":22279212,"avatar_url":"https://avatars1.githubusercontent.com/u/22279212?v=4","gravatar_id":"","url":"https://api.github.com/users/astonzhang","html_url":"https://github.com/astonzhang","followers_url":"https://api.github.com/users/astonzhang/followers","following_url":"https://api.github.com/users/astonzhang/following{/other_user}","gists_url":"https://api.github.com/users/astonzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/astonzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astonzhang/subscriptions","organizations_url":"https://api.github.com/users/astonzhang/orgs","repos_url":"https://api.github.com/users/astonzhang/repos","events_url":"https://api.github.com/users/astonzhang/events{/privacy}","received_events_url":"https://api.github.com/users/astonzhang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/astonzhang/mxnet","description":"Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more","fork":true,"url":"https://api.github.com/repos/astonzhang/mxnet","forks_url":"https://api.github.com/repos/astonzhang/mxnet/forks","keys_url":"https://api.github.com/repos/astonzhang/mxnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astonzhang/mxnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astonzhang/mxnet/teams","hooks_url":"https://api.github.com/repos/astonzhang/mxnet/hooks","issue_events_url":"https://api.github.com/repos/astonzhang/mxnet/issues/events{/number}","events_url":"https://api.github.com/repos/astonzhang/mxnet/events","assignees_url":"https://api.github.com/repos/astonzhang/mxnet/assignees{/user}","branches_url":"https://api.github.com/repos/astonzhang/mxnet/branches{/branch}","tags_url":"https://api.github.com/repos/astonzhang/mxnet/tags","blobs_url":"https://api.github.com/repos/astonzhang/mxnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astonzhang/mxnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astonzhang/mxnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/astonzhang/mxnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astonzhang/mxnet/statuses/{sha}","languages_url":"https://api.github.com/repos/astonzhang/mxnet/languages","stargazers_url":"https://api.github.com/repos/astonzhang/mxnet/stargazers","contributors_url":"https://api.github.com/repos/astonzhang/mxnet/contributors","subscribers_url":"https://api.github.com/repos/astonzhang/mxnet/subscribers","subscription_url":"https://api.github.com/repos/astonzhang/mxnet/subscription","commits_url":"https://api.github.com/repos/astonzhang/mxnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/astonzhang/mxnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/astonzhang/mxnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/astonzhang/mxnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/astonzhang/mxnet/contents/{+path}","compare_url":"https://api.github.com/repos/astonzhang/mxnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astonzhang/mxnet/merges","archive_url":"https://api.github.com/repos/astonzhang/mxnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astonzhang/mxnet/downloads","issues_url":"https://api.github.com/repos/astonzhang/mxnet/issues{/number}","pulls_url":"https://api.github.com/repos/astonzhang/mxnet/pulls{/number}","milestones_url":"https://api.github.com/repos/astonzhang/mxnet/milestones{/number}","notifications_url":"https://api.github.com/repos/astonzhang/mxnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astonzhang/mxnet/labels{/name}","releases_url":"https://api.github.com/repos/astonzhang/mxnet/releases{/id}","deployments_url":"https://api.github.com/repos/astonzhang/mxnet/deployments","created_at":"2017-03-22T05:27:30Z","updated_at":"2017-08-23T17:27:40Z","pushed_at":"2017-08-30T00:31:02Z","git_url":"git://github.com/astonzhang/mxnet.git","ssh_url":"git@github.com:astonzhang/mxnet.git","clone_url":"https://github.com/astonzhang/mxnet.git","svn_url":"https://github.com/astonzhang/mxnet","homepage":"http://mxnet.io","size":20486,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"62e6d2f99df23e601508142004124cb1ddc5ffaf","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":34864402,"name":"incubator-mxnet","full_name":"apache/incubator-mxnet","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-mxnet","description":"Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more","fork":false,"url":"https://api.github.com/repos/apache/incubator-mxnet","forks_url":"https://api.github.com/repos/apache/incubator-mxnet/forks","keys_url":"https://api.github.com/repos/apache/incubator-mxnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-mxnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-mxnet/teams","hooks_url":"https://api.github.com/repos/apache/incubator-mxnet/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-mxnet/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-mxnet/events","assignees_url":"https://api.github.com/repos/apache/incubator-mxnet/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-mxnet/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-mxnet/tags","blobs_url":"https://api.github.com/repos/apache/incubator-mxnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-mxnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-mxnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-mxnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-mxnet/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-mxnet/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-mxnet/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-mxnet/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-mxnet/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-mxnet/subscription","commits_url":"https://api.github.com/repos/apache/incubator-mxnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-mxnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-mxnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-mxnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-mxnet/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-mxnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-mxnet/merges","archive_url":"https://api.github.com/repos/apache/incubator-mxnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-mxnet/downloads","issues_url":"https://api.github.com/repos/apache/incubator-mxnet/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-mxnet/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-mxnet/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-mxnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-mxnet/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-mxnet/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-mxnet/deployments","created_at":"2015-04-30T16:21:15Z","updated_at":"2017-08-29T13:29:04Z","pushed_at":"2017-08-30T00:31:04Z","git_url":"git://github.com/apache/incubator-mxnet.git","ssh_url":"git@github.com:apache/incubator-mxnet.git","clone_url":"https://github.com/apache/incubator-mxnet.git","svn_url":"https://github.com/apache/incubator-mxnet","homepage":"http://mxnet.io","size":20448,"stargazers_count":10882,"watchers_count":10882,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4091,"mirror_url":null,"open_issues_count":1962,"forks":4091,"open_issues":1962,"watchers":10882,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-mxnet/pulls/7659"},"html":{"href":"https://github.com/apache/incubator-mxnet/pull/7659"},"issue":{"href":"https://api.github.com/repos/apache/incubator-mxnet/issues/7659"},"comments":{"href":"https://api.github.com/repos/apache/incubator-mxnet/issues/7659/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-mxnet/pulls/7659/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-mxnet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-mxnet/pulls/7659/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-mxnet/statuses/cfef07bf1a0af27e195a596596385ddc699e398d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"szha"}}