{"action":"created","comment":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/170481846","pull_request_review_id":99171249,"id":170481846,"diff_hunk":"@@ -36,10 +36,18 @@ class Optimizer(object):\n     \"\"\"\n \n     def __init__(self, learning_rate, global_step=None, regularization=None):\n-        assert learning_rate is not None\n+        if not isinstance(learning_rate, float) and \\\n+                not isinstance(learning_rate, framework.Variable):\n+            raise ValueError(\"learning rate should be float or Variable\")","path":"python/paddle/v2/fluid/optimizer.py","position":7,"original_position":7,"commit_id":"3b8bade61776d38686944ce9ebdf9b50e6bb9b9c","original_commit_id":"3b8bade61776d38686944ce9ebdf9b50e6bb9b9c","user":{"login":"reyoung","id":728699,"avatar_url":"https://avatars2.githubusercontent.com/u/728699?v=4","gravatar_id":"","url":"https://api.github.com/users/reyoung","html_url":"https://github.com/reyoung","followers_url":"https://api.github.com/users/reyoung/followers","following_url":"https://api.github.com/users/reyoung/following{/other_user}","gists_url":"https://api.github.com/users/reyoung/gists{/gist_id}","starred_url":"https://api.github.com/users/reyoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reyoung/subscriptions","organizations_url":"https://api.github.com/users/reyoung/orgs","repos_url":"https://api.github.com/users/reyoung/repos","events_url":"https://api.github.com/users/reyoung/events{/privacy}","received_events_url":"https://api.github.com/users/reyoung/received_events","type":"User","site_admin":false},"body":"TypeError","created_at":"2018-02-26T02:19:58Z","updated_at":"2018-02-26T02:19:59Z","html_url":"https://github.com/PaddlePaddle/Paddle/pull/8545#discussion_r170481846","pull_request_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8545","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/170481846"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/8545#discussion_r170481846"},"pull_request":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8545"}}},"pull_request":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8545","id":171169233,"html_url":"https://github.com/PaddlePaddle/Paddle/pull/8545","diff_url":"https://github.com/PaddlePaddle/Paddle/pull/8545.diff","patch_url":"https://github.com/PaddlePaddle/Paddle/pull/8545.patch","issue_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/8545","number":8545,"state":"open","locked":false,"title":"create learning rate for multi program","user":{"login":"jacquesqiao","id":3048612,"avatar_url":"https://avatars0.githubusercontent.com/u/3048612?v=4","gravatar_id":"","url":"https://api.github.com/users/jacquesqiao","html_url":"https://github.com/jacquesqiao","followers_url":"https://api.github.com/users/jacquesqiao/followers","following_url":"https://api.github.com/users/jacquesqiao/following{/other_user}","gists_url":"https://api.github.com/users/jacquesqiao/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquesqiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquesqiao/subscriptions","organizations_url":"https://api.github.com/users/jacquesqiao/orgs","repos_url":"https://api.github.com/users/jacquesqiao/repos","events_url":"https://api.github.com/users/jacquesqiao/events{/privacy}","received_events_url":"https://api.github.com/users/jacquesqiao/received_events","type":"User","site_admin":false},"body":"fix https://github.com/PaddlePaddle/Paddle/issues/8529\r\n\r\n## reason\r\nIn fc_gan demo, there are two programs that need to be optimized, but currently, the optimizer will only create learning_rate_var once. So the second program will not find the learning rate var.\r\n\r\n## detail\r\n`optimizer.minimize(loss, ...)` will create optimize ops and related variables in the block of `loss`. The current optimizer has a filed `optimizer._global_learning_rate` which will be created only once, in the fc_gan demo, the optimizer.minimize is called twice for two losses in two program, so the second optimizer.minimize cannot find learning rate variable in its Program.\r\n\r\n## solution\r\ncreate learning rate var for each program it optimized.","created_at":"2018-02-24T08:47:20Z","updated_at":"2018-02-26T02:19:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd5b5ef01f15f7db728a56e61ab787b805d7210a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8545/commits","review_comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8545/comments","review_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/8545/comments","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/3b8bade61776d38686944ce9ebdf9b50e6bb9b9c","head":{"label":"jacquesqiao:fix-optimize-multi-program","ref":"fix-optimize-multi-program","sha":"3b8bade61776d38686944ce9ebdf9b50e6bb9b9c","user":{"login":"jacquesqiao","id":3048612,"avatar_url":"https://avatars0.githubusercontent.com/u/3048612?v=4","gravatar_id":"","url":"https://api.github.com/users/jacquesqiao","html_url":"https://github.com/jacquesqiao","followers_url":"https://api.github.com/users/jacquesqiao/followers","following_url":"https://api.github.com/users/jacquesqiao/following{/other_user}","gists_url":"https://api.github.com/users/jacquesqiao/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquesqiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquesqiao/subscriptions","organizations_url":"https://api.github.com/users/jacquesqiao/orgs","repos_url":"https://api.github.com/users/jacquesqiao/repos","events_url":"https://api.github.com/users/jacquesqiao/events{/privacy}","received_events_url":"https://api.github.com/users/jacquesqiao/received_events","type":"User","site_admin":false},"repo":{"id":75146336,"name":"Paddle","full_name":"jacquesqiao/Paddle","owner":{"login":"jacquesqiao","id":3048612,"avatar_url":"https://avatars0.githubusercontent.com/u/3048612?v=4","gravatar_id":"","url":"https://api.github.com/users/jacquesqiao","html_url":"https://github.com/jacquesqiao","followers_url":"https://api.github.com/users/jacquesqiao/followers","following_url":"https://api.github.com/users/jacquesqiao/following{/other_user}","gists_url":"https://api.github.com/users/jacquesqiao/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquesqiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquesqiao/subscriptions","organizations_url":"https://api.github.com/users/jacquesqiao/orgs","repos_url":"https://api.github.com/users/jacquesqiao/repos","events_url":"https://api.github.com/users/jacquesqiao/events{/privacy}","received_events_url":"https://api.github.com/users/jacquesqiao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jacquesqiao/Paddle","description":"PArallel Distributed Deep LEarning","fork":true,"url":"https://api.github.com/repos/jacquesqiao/Paddle","forks_url":"https://api.github.com/repos/jacquesqiao/Paddle/forks","keys_url":"https://api.github.com/repos/jacquesqiao/Paddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacquesqiao/Paddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacquesqiao/Paddle/teams","hooks_url":"https://api.github.com/repos/jacquesqiao/Paddle/hooks","issue_events_url":"https://api.github.com/repos/jacquesqiao/Paddle/issues/events{/number}","events_url":"https://api.github.com/repos/jacquesqiao/Paddle/events","assignees_url":"https://api.github.com/repos/jacquesqiao/Paddle/assignees{/user}","branches_url":"https://api.github.com/repos/jacquesqiao/Paddle/branches{/branch}","tags_url":"https://api.github.com/repos/jacquesqiao/Paddle/tags","blobs_url":"https://api.github.com/repos/jacquesqiao/Paddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacquesqiao/Paddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacquesqiao/Paddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacquesqiao/Paddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacquesqiao/Paddle/statuses/{sha}","languages_url":"https://api.github.com/repos/jacquesqiao/Paddle/languages","stargazers_url":"https://api.github.com/repos/jacquesqiao/Paddle/stargazers","contributors_url":"https://api.github.com/repos/jacquesqiao/Paddle/contributors","subscribers_url":"https://api.github.com/repos/jacquesqiao/Paddle/subscribers","subscription_url":"https://api.github.com/repos/jacquesqiao/Paddle/subscription","commits_url":"https://api.github.com/repos/jacquesqiao/Paddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacquesqiao/Paddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacquesqiao/Paddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacquesqiao/Paddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/jacquesqiao/Paddle/contents/{+path}","compare_url":"https://api.github.com/repos/jacquesqiao/Paddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacquesqiao/Paddle/merges","archive_url":"https://api.github.com/repos/jacquesqiao/Paddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacquesqiao/Paddle/downloads","issues_url":"https://api.github.com/repos/jacquesqiao/Paddle/issues{/number}","pulls_url":"https://api.github.com/repos/jacquesqiao/Paddle/pulls{/number}","milestones_url":"https://api.github.com/repos/jacquesqiao/Paddle/milestones{/number}","notifications_url":"https://api.github.com/repos/jacquesqiao/Paddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacquesqiao/Paddle/labels{/name}","releases_url":"https://api.github.com/repos/jacquesqiao/Paddle/releases{/id}","deployments_url":"https://api.github.com/repos/jacquesqiao/Paddle/deployments","created_at":"2016-11-30T03:13:08Z","updated_at":"2016-11-30T03:13:12Z","pushed_at":"2018-02-24T09:27:48Z","git_url":"git://github.com/jacquesqiao/Paddle.git","ssh_url":"git@github.com:jacquesqiao/Paddle.git","clone_url":"https://github.com/jacquesqiao/Paddle.git","svn_url":"https://github.com/jacquesqiao/Paddle","homepage":"http://www.paddlepaddle.org/","size":52788,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"PaddlePaddle:develop","ref":"develop","sha":"44e301541256b966104bc1c67cab8638a0dafcfe","user":{"login":"PaddlePaddle","id":23534030,"avatar_url":"https://avatars3.githubusercontent.com/u/23534030?v=4","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"repo":{"id":65711522,"name":"Paddle","full_name":"PaddlePaddle/Paddle","owner":{"login":"PaddlePaddle","id":23534030,"avatar_url":"https://avatars3.githubusercontent.com/u/23534030?v=4","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PaddlePaddle/Paddle","description":"PArallel Distributed Deep LEarning","fork":false,"url":"https://api.github.com/repos/PaddlePaddle/Paddle","forks_url":"https://api.github.com/repos/PaddlePaddle/Paddle/forks","keys_url":"https://api.github.com/repos/PaddlePaddle/Paddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PaddlePaddle/Paddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PaddlePaddle/Paddle/teams","hooks_url":"https://api.github.com/repos/PaddlePaddle/Paddle/hooks","issue_events_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/events{/number}","events_url":"https://api.github.com/repos/PaddlePaddle/Paddle/events","assignees_url":"https://api.github.com/repos/PaddlePaddle/Paddle/assignees{/user}","branches_url":"https://api.github.com/repos/PaddlePaddle/Paddle/branches{/branch}","tags_url":"https://api.github.com/repos/PaddlePaddle/Paddle/tags","blobs_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/{sha}","languages_url":"https://api.github.com/repos/PaddlePaddle/Paddle/languages","stargazers_url":"https://api.github.com/repos/PaddlePaddle/Paddle/stargazers","contributors_url":"https://api.github.com/repos/PaddlePaddle/Paddle/contributors","subscribers_url":"https://api.github.com/repos/PaddlePaddle/Paddle/subscribers","subscription_url":"https://api.github.com/repos/PaddlePaddle/Paddle/subscription","commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/PaddlePaddle/Paddle/contents/{+path}","compare_url":"https://api.github.com/repos/PaddlePaddle/Paddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PaddlePaddle/Paddle/merges","archive_url":"https://api.github.com/repos/PaddlePaddle/Paddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PaddlePaddle/Paddle/downloads","issues_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues{/number}","pulls_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls{/number}","milestones_url":"https://api.github.com/repos/PaddlePaddle/Paddle/milestones{/number}","notifications_url":"https://api.github.com/repos/PaddlePaddle/Paddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PaddlePaddle/Paddle/labels{/name}","releases_url":"https://api.github.com/repos/PaddlePaddle/Paddle/releases{/id}","deployments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/deployments","created_at":"2016-08-15T06:59:08Z","updated_at":"2018-02-26T02:01:16Z","pushed_at":"2018-02-26T02:19:12Z","git_url":"git://github.com/PaddlePaddle/Paddle.git","ssh_url":"git@github.com:PaddlePaddle/Paddle.git","clone_url":"https://github.com/PaddlePaddle/Paddle.git","svn_url":"https://github.com/PaddlePaddle/Paddle","homepage":"http://www.paddlepaddle.org/","size":93417,"stargazers_count":6446,"watchers_count":6446,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1697,"mirror_url":null,"archived":false,"open_issues_count":1227,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1697,"open_issues":1227,"watchers":6446,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8545"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/8545"},"issue":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/8545"},"comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/8545/comments"},"review_comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8545/comments"},"review_comment":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8545/commits"},"statuses":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/3b8bade61776d38686944ce9ebdf9b50e6bb9b9c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"reyoung"}}