{"action":"created","comment":{"url":"https://api.github.com/repos/stan-dev/stan/pulls/comments/45012719","id":45012719,"diff_hunk":"@@ -49,12 +49,15 @@ namespace stan {\n \n     public:\n       // Constructors\n+\n+      // Constructs a zero-filled variational distribution\n       explicit normal_fullrank(size_t dimension) :\n         dimension_(dimension) {\n         mu_     = Eigen::VectorXd::Zero(dimension_);\n-        L_chol_  = Eigen::MatrixXd::Identity(dimension_, dimension_);\n+        L_chol_ = Eigen::MatrixXd::Zero(dimension_, dimension_);","path":"src/stan/variational/families/normal_fullrank.hpp","position":10,"original_position":10,"commit_id":"823d8fd0063b28e42bc76ef8bb6ad9c9f38423dd","original_commit_id":"823d8fd0063b28e42bc76ef8bb6ad9c9f38423dd","user":{"login":"bob-carpenter","id":3383807,"avatar_url":"https://avatars.githubusercontent.com/u/3383807?v=3","gravatar_id":"","url":"https://api.github.com/users/bob-carpenter","html_url":"https://github.com/bob-carpenter","followers_url":"https://api.github.com/users/bob-carpenter/followers","following_url":"https://api.github.com/users/bob-carpenter/following{/other_user}","gists_url":"https://api.github.com/users/bob-carpenter/gists{/gist_id}","starred_url":"https://api.github.com/users/bob-carpenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bob-carpenter/subscriptions","organizations_url":"https://api.github.com/users/bob-carpenter/orgs","repos_url":"https://api.github.com/users/bob-carpenter/repos","events_url":"https://api.github.com/users/bob-carpenter/events{/privacy}","received_events_url":"https://api.github.com/users/bob-carpenter/received_events","type":"User","site_admin":false},"body":"As far as I can tell, nothing ever changes the dimension so it should be declared `const`.","created_at":"2015-11-17T01:44:41Z","updated_at":"2015-11-17T01:44:41Z","html_url":"https://github.com/stan-dev/stan/pull/1693#discussion_r45012719","pull_request_url":"https://api.github.com/repos/stan-dev/stan/pulls/1693","_links":{"self":{"href":"https://api.github.com/repos/stan-dev/stan/pulls/comments/45012719"},"html":{"href":"https://github.com/stan-dev/stan/pull/1693#discussion_r45012719"},"pull_request":{"href":"https://api.github.com/repos/stan-dev/stan/pulls/1693"}}},"pull_request":{"url":"https://api.github.com/repos/stan-dev/stan/pulls/1693","id":50880264,"html_url":"https://github.com/stan-dev/stan/pull/1693","diff_url":"https://github.com/stan-dev/stan/pull/1693.diff","patch_url":"https://github.com/stan-dev/stan/pull/1693.patch","issue_url":"https://api.github.com/repos/stan-dev/stan/issues/1693","number":1693,"state":"open","locked":false,"title":"Implement ADVI variational family zero constructor and set to zero functionality ","user":{"login":"akucukelbir","id":329960,"avatar_url":"https://avatars.githubusercontent.com/u/329960?v=3","gravatar_id":"","url":"https://api.github.com/users/akucukelbir","html_url":"https://github.com/akucukelbir","followers_url":"https://api.github.com/users/akucukelbir/followers","following_url":"https://api.github.com/users/akucukelbir/following{/other_user}","gists_url":"https://api.github.com/users/akucukelbir/gists{/gist_id}","starred_url":"https://api.github.com/users/akucukelbir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akucukelbir/subscriptions","organizations_url":"https://api.github.com/users/akucukelbir/orgs","repos_url":"https://api.github.com/users/akucukelbir/repos","events_url":"https://api.github.com/users/akucukelbir/events{/privacy}","received_events_url":"https://api.github.com/users/akucukelbir/received_events","type":"User","site_admin":false},"body":"#### Summary:\r\nImplements two changes to the `meanfield` and `fullrank` variational families in ADVI:\r\n\r\n1. Implements a new constructor that only takes in a `size_t dimension` and initializes everything to a zero vector/matrix, as appropriate. \r\n2. Implements a `set_to_zero()` function that sets everything to a zero vector/matrix, as appropriate.\r\n\r\nThese are both important because we use instantiations of these objects to track the norm of our gradients across iterations. Initializating them to zero is useful. Being able to set them to zero will become important when we merge the automatic tuning branch for `eta`.\r\n\r\n#### Intended Effect:\r\n\r\n\r\n#### How to Verify:\r\nI've updated the unit tests. Should be straightforward to see the changes.\r\n\r\n#### Side Effects:\r\nNone\r\n\r\n#### Documentation:\r\nNone.\r\n\r\n#### Reviewer Suggestions:\r\n@dustinvtran for variational accuracy, @syclik @bob-carpenter for overall accuracy and mergability.","created_at":"2015-11-16T23:04:36Z","updated_at":"2015-11-17T01:44:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5c0b33f7a77031e2a4a54d680e6940b297f0fe0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/stan-dev/stan/pulls/1693/commits","review_comments_url":"https://api.github.com/repos/stan-dev/stan/pulls/1693/comments","review_comment_url":"https://api.github.com/repos/stan-dev/stan/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stan-dev/stan/issues/1693/comments","statuses_url":"https://api.github.com/repos/stan-dev/stan/statuses/823d8fd0063b28e42bc76ef8bb6ad9c9f38423dd","head":{"label":"stan-dev:feature/advi-improve-variational-families","ref":"feature/advi-improve-variational-families","sha":"823d8fd0063b28e42bc76ef8bb6ad9c9f38423dd","user":{"login":"stan-dev","id":3374820,"avatar_url":"https://avatars.githubusercontent.com/u/3374820?v=3","gravatar_id":"","url":"https://api.github.com/users/stan-dev","html_url":"https://github.com/stan-dev","followers_url":"https://api.github.com/users/stan-dev/followers","following_url":"https://api.github.com/users/stan-dev/following{/other_user}","gists_url":"https://api.github.com/users/stan-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/stan-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stan-dev/subscriptions","organizations_url":"https://api.github.com/users/stan-dev/orgs","repos_url":"https://api.github.com/users/stan-dev/repos","events_url":"https://api.github.com/users/stan-dev/events{/privacy}","received_events_url":"https://api.github.com/users/stan-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":8043756,"name":"stan","full_name":"stan-dev/stan","owner":{"login":"stan-dev","id":3374820,"avatar_url":"https://avatars.githubusercontent.com/u/3374820?v=3","gravatar_id":"","url":"https://api.github.com/users/stan-dev","html_url":"https://github.com/stan-dev","followers_url":"https://api.github.com/users/stan-dev/followers","following_url":"https://api.github.com/users/stan-dev/following{/other_user}","gists_url":"https://api.github.com/users/stan-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/stan-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stan-dev/subscriptions","organizations_url":"https://api.github.com/users/stan-dev/orgs","repos_url":"https://api.github.com/users/stan-dev/repos","events_url":"https://api.github.com/users/stan-dev/events{/privacy}","received_events_url":"https://api.github.com/users/stan-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stan-dev/stan","description":"Stan development repository (home page is linked below). The master branch contains the current release. The develop branch contains the latest stable development.  See the Developer Process Wiki for details.  ","fork":false,"url":"https://api.github.com/repos/stan-dev/stan","forks_url":"https://api.github.com/repos/stan-dev/stan/forks","keys_url":"https://api.github.com/repos/stan-dev/stan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stan-dev/stan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stan-dev/stan/teams","hooks_url":"https://api.github.com/repos/stan-dev/stan/hooks","issue_events_url":"https://api.github.com/repos/stan-dev/stan/issues/events{/number}","events_url":"https://api.github.com/repos/stan-dev/stan/events","assignees_url":"https://api.github.com/repos/stan-dev/stan/assignees{/user}","branches_url":"https://api.github.com/repos/stan-dev/stan/branches{/branch}","tags_url":"https://api.github.com/repos/stan-dev/stan/tags","blobs_url":"https://api.github.com/repos/stan-dev/stan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stan-dev/stan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stan-dev/stan/git/refs{/sha}","trees_url":"https://api.github.com/repos/stan-dev/stan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stan-dev/stan/statuses/{sha}","languages_url":"https://api.github.com/repos/stan-dev/stan/languages","stargazers_url":"https://api.github.com/repos/stan-dev/stan/stargazers","contributors_url":"https://api.github.com/repos/stan-dev/stan/contributors","subscribers_url":"https://api.github.com/repos/stan-dev/stan/subscribers","subscription_url":"https://api.github.com/repos/stan-dev/stan/subscription","commits_url":"https://api.github.com/repos/stan-dev/stan/commits{/sha}","git_commits_url":"https://api.github.com/repos/stan-dev/stan/git/commits{/sha}","comments_url":"https://api.github.com/repos/stan-dev/stan/comments{/number}","issue_comment_url":"https://api.github.com/repos/stan-dev/stan/issues/comments{/number}","contents_url":"https://api.github.com/repos/stan-dev/stan/contents/{+path}","compare_url":"https://api.github.com/repos/stan-dev/stan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stan-dev/stan/merges","archive_url":"https://api.github.com/repos/stan-dev/stan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stan-dev/stan/downloads","issues_url":"https://api.github.com/repos/stan-dev/stan/issues{/number}","pulls_url":"https://api.github.com/repos/stan-dev/stan/pulls{/number}","milestones_url":"https://api.github.com/repos/stan-dev/stan/milestones{/number}","notifications_url":"https://api.github.com/repos/stan-dev/stan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stan-dev/stan/labels{/name}","releases_url":"https://api.github.com/repos/stan-dev/stan/releases{/id}","created_at":"2013-02-06T03:25:04Z","updated_at":"2015-11-16T19:51:38Z","pushed_at":"2015-11-17T00:59:54Z","git_url":"git://github.com/stan-dev/stan.git","ssh_url":"git@github.com:stan-dev/stan.git","clone_url":"https://github.com/stan-dev/stan.git","svn_url":"https://github.com/stan-dev/stan","homepage":"http://mc-stan.org","size":218357,"stargazers_count":472,"watchers_count":472,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":113,"mirror_url":null,"open_issues_count":211,"forks":113,"open_issues":211,"watchers":472,"default_branch":"develop"}},"base":{"label":"stan-dev:develop","ref":"develop","sha":"bda642f7b9b1b45c201885b74e55d84eb705c05e","user":{"login":"stan-dev","id":3374820,"avatar_url":"https://avatars.githubusercontent.com/u/3374820?v=3","gravatar_id":"","url":"https://api.github.com/users/stan-dev","html_url":"https://github.com/stan-dev","followers_url":"https://api.github.com/users/stan-dev/followers","following_url":"https://api.github.com/users/stan-dev/following{/other_user}","gists_url":"https://api.github.com/users/stan-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/stan-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stan-dev/subscriptions","organizations_url":"https://api.github.com/users/stan-dev/orgs","repos_url":"https://api.github.com/users/stan-dev/repos","events_url":"https://api.github.com/users/stan-dev/events{/privacy}","received_events_url":"https://api.github.com/users/stan-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":8043756,"name":"stan","full_name":"stan-dev/stan","owner":{"login":"stan-dev","id":3374820,"avatar_url":"https://avatars.githubusercontent.com/u/3374820?v=3","gravatar_id":"","url":"https://api.github.com/users/stan-dev","html_url":"https://github.com/stan-dev","followers_url":"https://api.github.com/users/stan-dev/followers","following_url":"https://api.github.com/users/stan-dev/following{/other_user}","gists_url":"https://api.github.com/users/stan-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/stan-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stan-dev/subscriptions","organizations_url":"https://api.github.com/users/stan-dev/orgs","repos_url":"https://api.github.com/users/stan-dev/repos","events_url":"https://api.github.com/users/stan-dev/events{/privacy}","received_events_url":"https://api.github.com/users/stan-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stan-dev/stan","description":"Stan development repository (home page is linked below). The master branch contains the current release. The develop branch contains the latest stable development.  See the Developer Process Wiki for details.  ","fork":false,"url":"https://api.github.com/repos/stan-dev/stan","forks_url":"https://api.github.com/repos/stan-dev/stan/forks","keys_url":"https://api.github.com/repos/stan-dev/stan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stan-dev/stan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stan-dev/stan/teams","hooks_url":"https://api.github.com/repos/stan-dev/stan/hooks","issue_events_url":"https://api.github.com/repos/stan-dev/stan/issues/events{/number}","events_url":"https://api.github.com/repos/stan-dev/stan/events","assignees_url":"https://api.github.com/repos/stan-dev/stan/assignees{/user}","branches_url":"https://api.github.com/repos/stan-dev/stan/branches{/branch}","tags_url":"https://api.github.com/repos/stan-dev/stan/tags","blobs_url":"https://api.github.com/repos/stan-dev/stan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stan-dev/stan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stan-dev/stan/git/refs{/sha}","trees_url":"https://api.github.com/repos/stan-dev/stan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stan-dev/stan/statuses/{sha}","languages_url":"https://api.github.com/repos/stan-dev/stan/languages","stargazers_url":"https://api.github.com/repos/stan-dev/stan/stargazers","contributors_url":"https://api.github.com/repos/stan-dev/stan/contributors","subscribers_url":"https://api.github.com/repos/stan-dev/stan/subscribers","subscription_url":"https://api.github.com/repos/stan-dev/stan/subscription","commits_url":"https://api.github.com/repos/stan-dev/stan/commits{/sha}","git_commits_url":"https://api.github.com/repos/stan-dev/stan/git/commits{/sha}","comments_url":"https://api.github.com/repos/stan-dev/stan/comments{/number}","issue_comment_url":"https://api.github.com/repos/stan-dev/stan/issues/comments{/number}","contents_url":"https://api.github.com/repos/stan-dev/stan/contents/{+path}","compare_url":"https://api.github.com/repos/stan-dev/stan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stan-dev/stan/merges","archive_url":"https://api.github.com/repos/stan-dev/stan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stan-dev/stan/downloads","issues_url":"https://api.github.com/repos/stan-dev/stan/issues{/number}","pulls_url":"https://api.github.com/repos/stan-dev/stan/pulls{/number}","milestones_url":"https://api.github.com/repos/stan-dev/stan/milestones{/number}","notifications_url":"https://api.github.com/repos/stan-dev/stan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stan-dev/stan/labels{/name}","releases_url":"https://api.github.com/repos/stan-dev/stan/releases{/id}","created_at":"2013-02-06T03:25:04Z","updated_at":"2015-11-16T19:51:38Z","pushed_at":"2015-11-17T00:59:54Z","git_url":"git://github.com/stan-dev/stan.git","ssh_url":"git@github.com:stan-dev/stan.git","clone_url":"https://github.com/stan-dev/stan.git","svn_url":"https://github.com/stan-dev/stan","homepage":"http://mc-stan.org","size":218357,"stargazers_count":472,"watchers_count":472,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":113,"mirror_url":null,"open_issues_count":211,"forks":113,"open_issues":211,"watchers":472,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/stan-dev/stan/pulls/1693"},"html":{"href":"https://github.com/stan-dev/stan/pull/1693"},"issue":{"href":"https://api.github.com/repos/stan-dev/stan/issues/1693"},"comments":{"href":"https://api.github.com/repos/stan-dev/stan/issues/1693/comments"},"review_comments":{"href":"https://api.github.com/repos/stan-dev/stan/pulls/1693/comments"},"review_comment":{"href":"https://api.github.com/repos/stan-dev/stan/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stan-dev/stan/pulls/1693/commits"},"statuses":{"href":"https://api.github.com/repos/stan-dev/stan/statuses/823d8fd0063b28e42bc76ef8bb6ad9c9f38423dd"}}}}