{"action":"created","issue":{"url":"https://api.github.com/repos/probmods/webppl/issues/712","repository_url":"https://api.github.com/repos/probmods/webppl","labels_url":"https://api.github.com/repos/probmods/webppl/issues/712/labels{/name}","comments_url":"https://api.github.com/repos/probmods/webppl/issues/712/comments","events_url":"https://api.github.com/repos/probmods/webppl/issues/712/events","html_url":"https://github.com/probmods/webppl/pull/712","id":191360251,"number":712,"title":"List of samples backed marginal","user":{"login":"null-a","id":9109012,"avatar_url":"https://avatars.githubusercontent.com/u/9109012?v=3","gravatar_id":"","url":"https://api.github.com/users/null-a","html_url":"https://github.com/null-a","followers_url":"https://api.github.com/users/null-a/followers","following_url":"https://api.github.com/users/null-a/following{/other_user}","gists_url":"https://api.github.com/users/null-a/gists{/gist_id}","starred_url":"https://api.github.com/users/null-a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/null-a/subscriptions","organizations_url":"https://api.github.com/users/null-a/orgs","repos_url":"https://api.github.com/users/null-a/repos","events_url":"https://api.github.com/users/null-a/events{/privacy}","received_events_url":"https://api.github.com/users/null-a/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-23T19:24:07Z","updated_at":"2016-11-23T19:42:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/probmods/webppl/pulls/712","html_url":"https://github.com/probmods/webppl/pull/712","diff_url":"https://github.com/probmods/webppl/pull/712.diff","patch_url":"https://github.com/probmods/webppl/pull/712.patch"},"body":"This adds a new \"list of samples\" backed marginal distribution (as discussed in #631), and uses it as the return value for all sampling based inference algorithms.\r\n\r\nThere's one interface change that comes along with this: The `justSample` option of `MCMC`/`IncrementalMH` no longer exists, since marginals returned by sampling algorithms *always* have the `samples` property available. (This just returns the list of samples that backs the marginal.)\r\n\r\nThe `onlyMAP` option still exists, and works as before. Following Daniel, I've also added this option to `SMC`.\r\n\r\nI see two possible objections to this change as it stands:\r\n\r\n1. There are some scenarios where building the histogram as we go might be better strategy. For example, if you are taking many, many, samples but are only sampling from a small set of simple values (e.g Bools) then building the histogram as you go saves keeping a giant array in memory. I'm not certain whether this is likely to be a problem for us in practice though? I've tested sampling `1e6` coin flips using `MCMC`, and this change doesn't noticeably change the run time.\r\n\r\n2. The `samples` property is an array of objects like `{value: ..., score: ...}`. This format is inherited from the old `justSample` option. At present, not all algorithms compute the joint score of a sample, so for those I currently set the `score` property of these objects to zero. This seems messy, so we might want to compute the score everywhere, or if there's no value in that perhaps we just omit the `score` property when we don't have it.\r\n\r\nCloses #631."},"comment":{"url":"https://api.github.com/repos/probmods/webppl/issues/comments/262612581","html_url":"https://github.com/probmods/webppl/pull/712#issuecomment-262612581","issue_url":"https://api.github.com/repos/probmods/webppl/issues/712","id":262612581,"user":{"login":"dritchie","id":2229830,"avatar_url":"https://avatars.githubusercontent.com/u/2229830?v=3","gravatar_id":"","url":"https://api.github.com/users/dritchie","html_url":"https://github.com/dritchie","followers_url":"https://api.github.com/users/dritchie/followers","following_url":"https://api.github.com/users/dritchie/following{/other_user}","gists_url":"https://api.github.com/users/dritchie/gists{/gist_id}","starred_url":"https://api.github.com/users/dritchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dritchie/subscriptions","organizations_url":"https://api.github.com/users/dritchie/orgs","repos_url":"https://api.github.com/users/dritchie/repos","events_url":"https://api.github.com/users/dritchie/events{/privacy}","received_events_url":"https://api.github.com/users/dritchie/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T19:42:15Z","updated_at":"2016-11-23T19:42:15Z","body":"This makes me very, very happy. That's it, just wanted to say that :)"}}
{"actor":{"display_login":"dritchie"}}