{"action":"created","comment":{"url":"https://api.github.com/repos/uber/pyro/pulls/comments/202832605","pull_request_review_id":137606753,"id":202832605,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjgzMjYwNQ==","diff_hunk":"@@ -51,6 +59,19 @@ def _loss_and_grads(*args, **kwargs):\n             self.loss = loss\n             self.loss_and_grads = loss_and_grads\n \n+    def run(self, *args, **kwargs):\n+        if self.num_steps > 0:\n+            with poutine.block():\n+                for i in range(self.num_steps):\n+                    self.step(*args, **kwargs)\n+        return super(SVI, self).run(*args, **kwargs)\n+\n+    def _traces(self, *args, **kwargs):\n+        for i in range(self.num_samples):\n+            guide_trace = poutine.trace(self.guide).get_trace(*args, **kwargs)\n+            model_trace = poutine.trace(poutine.replay(self.model, trace=guide_trace)).get_trace(*args, **kwargs)\n+            yield model_trace, (model_trace.log_prob_sum() - guide_trace.log_prob_sum())","path":"pyro/infer/svi.py","position":54,"original_position":54,"commit_id":"90301e38f4ec27af1035b64a056dbdfa6f8f89d3","original_commit_id":"90301e38f4ec27af1035b64a056dbdfa6f8f89d3","user":{"login":"neerajprad","id":1762463,"node_id":"MDQ6VXNlcjE3NjI0NjM=","avatar_url":"https://avatars3.githubusercontent.com/u/1762463?v=4","gravatar_id":"","url":"https://api.github.com/users/neerajprad","html_url":"https://github.com/neerajprad","followers_url":"https://api.github.com/users/neerajprad/followers","following_url":"https://api.github.com/users/neerajprad/following{/other_user}","gists_url":"https://api.github.com/users/neerajprad/gists{/gist_id}","starred_url":"https://api.github.com/users/neerajprad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neerajprad/subscriptions","organizations_url":"https://api.github.com/users/neerajprad/orgs","repos_url":"https://api.github.com/users/neerajprad/repos","events_url":"https://api.github.com/users/neerajprad/events{/privacy}","received_events_url":"https://api.github.com/users/neerajprad/received_events","type":"User","site_admin":false},"body":"We can probably set the importance weights to some constant here, right (seems like double adjustment otherwise)?","created_at":"2018-07-16T21:36:59Z","updated_at":"2018-07-16T21:37:51Z","html_url":"https://github.com/uber/pyro/pull/1231#discussion_r202832605","pull_request_url":"https://api.github.com/repos/uber/pyro/pulls/1231","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/uber/pyro/pulls/comments/202832605"},"html":{"href":"https://github.com/uber/pyro/pull/1231#discussion_r202832605"},"pull_request":{"href":"https://api.github.com/repos/uber/pyro/pulls/1231"}}},"pull_request":{"url":"https://api.github.com/repos/uber/pyro/pulls/1231","id":201538750,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNTM4NzUw","html_url":"https://github.com/uber/pyro/pull/1231","diff_url":"https://github.com/uber/pyro/pull/1231.diff","patch_url":"https://github.com/uber/pyro/pull/1231.patch","issue_url":"https://api.github.com/repos/uber/pyro/issues/1231","number":1231,"state":"open","locked":false,"title":"Make SVI a TracePosterior subclass","user":{"login":"eb8680","id":2032320,"node_id":"MDQ6VXNlcjIwMzIzMjA=","avatar_url":"https://avatars0.githubusercontent.com/u/2032320?v=4","gravatar_id":"","url":"https://api.github.com/users/eb8680","html_url":"https://github.com/eb8680","followers_url":"https://api.github.com/users/eb8680/followers","following_url":"https://api.github.com/users/eb8680/following{/other_user}","gists_url":"https://api.github.com/users/eb8680/gists{/gist_id}","starred_url":"https://api.github.com/users/eb8680/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eb8680/subscriptions","organizations_url":"https://api.github.com/users/eb8680/orgs","repos_url":"https://api.github.com/users/eb8680/repos","events_url":"https://api.github.com/users/eb8680/events{/privacy}","received_events_url":"https://api.github.com/users/eb8680/received_events","type":"User","site_admin":false},"body":"Part of #1227 \r\n\r\nThis PR makes SVI a `TracePosterior` instance again, allowing it to be used with `EmpiricalMarginal` and more easily swapped out with `MCMC` and other inference algorithms.  It also updates `contrib.oed` to reflect this change.","created_at":"2018-07-16T04:31:30Z","updated_at":"2018-07-16T21:37:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c47aa64c186ca7a611ddefb4a50b45a218d4ca50","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ae-foster","id":6099494,"node_id":"MDQ6VXNlcjYwOTk0OTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/6099494?v=4","gravatar_id":"","url":"https://api.github.com/users/ae-foster","html_url":"https://github.com/ae-foster","followers_url":"https://api.github.com/users/ae-foster/followers","following_url":"https://api.github.com/users/ae-foster/following{/other_user}","gists_url":"https://api.github.com/users/ae-foster/gists{/gist_id}","starred_url":"https://api.github.com/users/ae-foster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ae-foster/subscriptions","organizations_url":"https://api.github.com/users/ae-foster/orgs","repos_url":"https://api.github.com/users/ae-foster/repos","events_url":"https://api.github.com/users/ae-foster/events{/privacy}","received_events_url":"https://api.github.com/users/ae-foster/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":704871691,"node_id":"MDU6TGFiZWw3MDQ4NzE2OTE=","url":"https://api.github.com/repos/uber/pyro/labels/awaiting%20review","name":"awaiting review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/uber/pyro/pulls/1231/commits","review_comments_url":"https://api.github.com/repos/uber/pyro/pulls/1231/comments","review_comment_url":"https://api.github.com/repos/uber/pyro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/pyro/issues/1231/comments","statuses_url":"https://api.github.com/repos/uber/pyro/statuses/90301e38f4ec27af1035b64a056dbdfa6f8f89d3","head":{"label":"eb8680:svi-traceposterior","ref":"svi-traceposterior","sha":"90301e38f4ec27af1035b64a056dbdfa6f8f89d3","user":{"login":"eb8680","id":2032320,"node_id":"MDQ6VXNlcjIwMzIzMjA=","avatar_url":"https://avatars0.githubusercontent.com/u/2032320?v=4","gravatar_id":"","url":"https://api.github.com/users/eb8680","html_url":"https://github.com/eb8680","followers_url":"https://api.github.com/users/eb8680/followers","following_url":"https://api.github.com/users/eb8680/following{/other_user}","gists_url":"https://api.github.com/users/eb8680/gists{/gist_id}","starred_url":"https://api.github.com/users/eb8680/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eb8680/subscriptions","organizations_url":"https://api.github.com/users/eb8680/orgs","repos_url":"https://api.github.com/users/eb8680/repos","events_url":"https://api.github.com/users/eb8680/events{/privacy}","received_events_url":"https://api.github.com/users/eb8680/received_events","type":"User","site_admin":false},"repo":{"id":121307774,"node_id":"MDEwOlJlcG9zaXRvcnkxMjEzMDc3NzQ=","name":"pyro","full_name":"eb8680/pyro","owner":{"login":"eb8680","id":2032320,"node_id":"MDQ6VXNlcjIwMzIzMjA=","avatar_url":"https://avatars0.githubusercontent.com/u/2032320?v=4","gravatar_id":"","url":"https://api.github.com/users/eb8680","html_url":"https://github.com/eb8680","followers_url":"https://api.github.com/users/eb8680/followers","following_url":"https://api.github.com/users/eb8680/following{/other_user}","gists_url":"https://api.github.com/users/eb8680/gists{/gist_id}","starred_url":"https://api.github.com/users/eb8680/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eb8680/subscriptions","organizations_url":"https://api.github.com/users/eb8680/orgs","repos_url":"https://api.github.com/users/eb8680/repos","events_url":"https://api.github.com/users/eb8680/events{/privacy}","received_events_url":"https://api.github.com/users/eb8680/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eb8680/pyro","description":"Deep universal probabilistic programming with Python and PyTorch","fork":true,"url":"https://api.github.com/repos/eb8680/pyro","forks_url":"https://api.github.com/repos/eb8680/pyro/forks","keys_url":"https://api.github.com/repos/eb8680/pyro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eb8680/pyro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eb8680/pyro/teams","hooks_url":"https://api.github.com/repos/eb8680/pyro/hooks","issue_events_url":"https://api.github.com/repos/eb8680/pyro/issues/events{/number}","events_url":"https://api.github.com/repos/eb8680/pyro/events","assignees_url":"https://api.github.com/repos/eb8680/pyro/assignees{/user}","branches_url":"https://api.github.com/repos/eb8680/pyro/branches{/branch}","tags_url":"https://api.github.com/repos/eb8680/pyro/tags","blobs_url":"https://api.github.com/repos/eb8680/pyro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eb8680/pyro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eb8680/pyro/git/refs{/sha}","trees_url":"https://api.github.com/repos/eb8680/pyro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eb8680/pyro/statuses/{sha}","languages_url":"https://api.github.com/repos/eb8680/pyro/languages","stargazers_url":"https://api.github.com/repos/eb8680/pyro/stargazers","contributors_url":"https://api.github.com/repos/eb8680/pyro/contributors","subscribers_url":"https://api.github.com/repos/eb8680/pyro/subscribers","subscription_url":"https://api.github.com/repos/eb8680/pyro/subscription","commits_url":"https://api.github.com/repos/eb8680/pyro/commits{/sha}","git_commits_url":"https://api.github.com/repos/eb8680/pyro/git/commits{/sha}","comments_url":"https://api.github.com/repos/eb8680/pyro/comments{/number}","issue_comment_url":"https://api.github.com/repos/eb8680/pyro/issues/comments{/number}","contents_url":"https://api.github.com/repos/eb8680/pyro/contents/{+path}","compare_url":"https://api.github.com/repos/eb8680/pyro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eb8680/pyro/merges","archive_url":"https://api.github.com/repos/eb8680/pyro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eb8680/pyro/downloads","issues_url":"https://api.github.com/repos/eb8680/pyro/issues{/number}","pulls_url":"https://api.github.com/repos/eb8680/pyro/pulls{/number}","milestones_url":"https://api.github.com/repos/eb8680/pyro/milestones{/number}","notifications_url":"https://api.github.com/repos/eb8680/pyro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eb8680/pyro/labels{/name}","releases_url":"https://api.github.com/repos/eb8680/pyro/releases{/id}","deployments_url":"https://api.github.com/repos/eb8680/pyro/deployments","created_at":"2018-02-12T22:03:22Z","updated_at":"2018-07-11T17:35:50Z","pushed_at":"2018-07-16T18:42:26Z","git_url":"git://github.com/eb8680/pyro.git","ssh_url":"git@github.com:eb8680/pyro.git","clone_url":"https://github.com/eb8680/pyro.git","svn_url":"https://github.com/eb8680/pyro","homepage":"http://pyro.ai","size":59048,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"uber:dev","ref":"dev","sha":"c8e76fd64fd0ba58a43a5023427479035ef80a3f","user":{"login":"uber","id":538264,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzODI2NA==","avatar_url":"https://avatars3.githubusercontent.com/u/538264?v=4","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":94506832,"node_id":"MDEwOlJlcG9zaXRvcnk5NDUwNjgzMg==","name":"pyro","full_name":"uber/pyro","owner":{"login":"uber","id":538264,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzODI2NA==","avatar_url":"https://avatars3.githubusercontent.com/u/538264?v=4","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/pyro","description":"Deep universal probabilistic programming with Python and PyTorch","fork":false,"url":"https://api.github.com/repos/uber/pyro","forks_url":"https://api.github.com/repos/uber/pyro/forks","keys_url":"https://api.github.com/repos/uber/pyro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/pyro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/pyro/teams","hooks_url":"https://api.github.com/repos/uber/pyro/hooks","issue_events_url":"https://api.github.com/repos/uber/pyro/issues/events{/number}","events_url":"https://api.github.com/repos/uber/pyro/events","assignees_url":"https://api.github.com/repos/uber/pyro/assignees{/user}","branches_url":"https://api.github.com/repos/uber/pyro/branches{/branch}","tags_url":"https://api.github.com/repos/uber/pyro/tags","blobs_url":"https://api.github.com/repos/uber/pyro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/pyro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/pyro/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/pyro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/pyro/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/pyro/languages","stargazers_url":"https://api.github.com/repos/uber/pyro/stargazers","contributors_url":"https://api.github.com/repos/uber/pyro/contributors","subscribers_url":"https://api.github.com/repos/uber/pyro/subscribers","subscription_url":"https://api.github.com/repos/uber/pyro/subscription","commits_url":"https://api.github.com/repos/uber/pyro/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/pyro/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/pyro/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/pyro/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/pyro/contents/{+path}","compare_url":"https://api.github.com/repos/uber/pyro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/pyro/merges","archive_url":"https://api.github.com/repos/uber/pyro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/pyro/downloads","issues_url":"https://api.github.com/repos/uber/pyro/issues{/number}","pulls_url":"https://api.github.com/repos/uber/pyro/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/pyro/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/pyro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/pyro/labels{/name}","releases_url":"https://api.github.com/repos/uber/pyro/releases{/id}","deployments_url":"https://api.github.com/repos/uber/pyro/deployments","created_at":"2017-06-16T05:03:47Z","updated_at":"2018-07-16T18:48:19Z","pushed_at":"2018-07-16T21:08:07Z","git_url":"git://github.com/uber/pyro.git","ssh_url":"git@github.com:uber/pyro.git","clone_url":"https://github.com/uber/pyro.git","svn_url":"https://github.com/uber/pyro","homepage":"http://pyro.ai","size":59697,"stargazers_count":3751,"watchers_count":3751,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":384,"mirror_url":null,"archived":false,"open_issues_count":53,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":384,"open_issues":53,"watchers":3751,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/pyro/pulls/1231"},"html":{"href":"https://github.com/uber/pyro/pull/1231"},"issue":{"href":"https://api.github.com/repos/uber/pyro/issues/1231"},"comments":{"href":"https://api.github.com/repos/uber/pyro/issues/1231/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/pyro/pulls/1231/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/pyro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/pyro/pulls/1231/commits"},"statuses":{"href":"https://api.github.com/repos/uber/pyro/statuses/90301e38f4ec27af1035b64a056dbdfa6f8f89d3"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"neerajprad"}}