{"action":"created","issue":{"url":"https://api.github.com/repos/uber/pyro/issues/1137","repository_url":"https://api.github.com/repos/uber/pyro","labels_url":"https://api.github.com/repos/uber/pyro/issues/1137/labels{/name}","comments_url":"https://api.github.com/repos/uber/pyro/issues/1137/comments","events_url":"https://api.github.com/repos/uber/pyro/issues/1137/events","html_url":"https://github.com/uber/pyro/issues/1137","id":322383466,"node_id":"MDU6SXNzdWUzMjIzODM0NjY=","number":1137,"title":"Mass Matrix Adaptation for HMC and NUTS","user":{"login":"LoganWalls","id":2934282,"node_id":"MDQ6VXNlcjI5MzQyODI=","avatar_url":"https://avatars3.githubusercontent.com/u/2934282?v=4","gravatar_id":"","url":"https://api.github.com/users/LoganWalls","html_url":"https://github.com/LoganWalls","followers_url":"https://api.github.com/users/LoganWalls/followers","following_url":"https://api.github.com/users/LoganWalls/following{/other_user}","gists_url":"https://api.github.com/users/LoganWalls/gists{/gist_id}","starred_url":"https://api.github.com/users/LoganWalls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LoganWalls/subscriptions","organizations_url":"https://api.github.com/users/LoganWalls/orgs","repos_url":"https://api.github.com/users/LoganWalls/repos","events_url":"https://api.github.com/users/LoganWalls/events{/privacy}","received_events_url":"https://api.github.com/users/LoganWalls/received_events","type":"User","site_admin":false},"labels":[{"id":634787400,"node_id":"MDU6TGFiZWw2MzQ3ODc0MDA=","url":"https://api.github.com/repos/uber/pyro/labels/discussion","name":"discussion","color":"fef2c0","default":false},{"id":627803347,"node_id":"MDU6TGFiZWw2Mjc4MDMzNDc=","url":"https://api.github.com/repos/uber/pyro/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":26,"created_at":"2018-05-11T17:59:25Z","updated_at":"2018-10-16T11:32:49Z","closed_at":"2018-10-16T11:32:49Z","author_association":"CONTRIBUTOR","body":"I'd like to contribute the mass matrix adaptation mentioned in #1093 . I actually have some preliminary work on it already, but I've run into an issue and I'm not sure how you'd like to proceed: \r\n\r\nCurrently the MCMC kernels have no access to the number of warmup iterations (since transition between warmup and sampling is handled by the MCMC wrapper), but if we want to adapt the mass matrix during warmup using a block scheme similar to stan (see section 34.2 in the [stan reference manual](http://mc-stan.org/users/documentation/)) then the kernel needs access to the number of warmup iterations to divide the warmup into blocks.\r\n\r\nI thought about putting this scheduling logic into the MCMC wrapper, but since adapting a mass matrix in this way is specific to certain kernels (HMC and NUTS) it feels like it belongs in the kernels themselves.\r\n\r\nHowever, giving the kernels access to the number of warmup iterations is not quite straightforward: since they are initialized by the user (not the MCMC wrapper) we can't pass it to the constructor, and currently all of the arguments to `HMC.setup()` are passed directly into `get_trace()`.\r\n\r\nSome options that come to mind are:\r\n\r\n1. Add the number of warmup iterations as a parameter in `HMC.setup()` (Seems reasonably clean to me, but maybe I'm missing something?)\r\n2. Implementing something like `kernel.configure_adaptation(warmup_duration=200)` which would be called by the wrapper. (This approach feels less clean because maybe not every kernel will need parameter adaptation, but it won't modify the existing `kernel.setup()` signature).\r\n3. In the MCMC wrapper directly set a property on the kernel: `self.kernel.warmup_duration = 200`. (Simple, but feels more like a hack).\r\n\r\nAny thoughts on which of these options (or others?) would be the best approach? "},"comment":{"url":"https://api.github.com/repos/uber/pyro/issues/comments/430202938","html_url":"https://github.com/uber/pyro/issues/1137#issuecomment-430202938","issue_url":"https://api.github.com/repos/uber/pyro/issues/1137","id":430202938,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDIwMjkzOA==","user":{"login":"fehiepsi","id":4736342,"node_id":"MDQ6VXNlcjQ3MzYzNDI=","avatar_url":"https://avatars1.githubusercontent.com/u/4736342?v=4","gravatar_id":"","url":"https://api.github.com/users/fehiepsi","html_url":"https://github.com/fehiepsi","followers_url":"https://api.github.com/users/fehiepsi/followers","following_url":"https://api.github.com/users/fehiepsi/following{/other_user}","gists_url":"https://api.github.com/users/fehiepsi/gists{/gist_id}","starred_url":"https://api.github.com/users/fehiepsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fehiepsi/subscriptions","organizations_url":"https://api.github.com/users/fehiepsi/orgs","repos_url":"https://api.github.com/users/fehiepsi/repos","events_url":"https://api.github.com/users/fehiepsi/events{/privacy}","received_events_url":"https://api.github.com/users/fehiepsi/received_events","type":"User","site_admin":false},"created_at":"2018-10-16T11:32:49Z","updated_at":"2018-10-16T11:32:49Z","author_association":"COLLABORATOR","body":"Closed via #1442."}}
{"actor":{"display_login":"fehiepsi"}}