{"action":"closed","number":422,"pull_request":{"url":"https://api.github.com/repos/torch/nn/pulls/422","id":46996513,"html_url":"https://github.com/torch/nn/pull/422","diff_url":"https://github.com/torch/nn/pull/422.diff","patch_url":"https://github.com/torch/nn/pull/422.patch","issue_url":"https://api.github.com/repos/torch/nn/issues/422","number":422,"state":"closed","locked":false,"title":"Add note on training shared models","user":{"login":"fmassa","id":9110200,"avatar_url":"https://avatars.githubusercontent.com/u/9110200?v=3","gravatar_id":"","url":"https://api.github.com/users/fmassa","html_url":"https://github.com/fmassa","followers_url":"https://api.github.com/users/fmassa/followers","following_url":"https://api.github.com/users/fmassa/following{/other_user}","gists_url":"https://api.github.com/users/fmassa/gists{/gist_id}","starred_url":"https://api.github.com/users/fmassa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmassa/subscriptions","organizations_url":"https://api.github.com/users/fmassa/orgs","repos_url":"https://api.github.com/users/fmassa/repos","events_url":"https://api.github.com/users/fmassa/events{/privacy}","received_events_url":"https://api.github.com/users/fmassa/received_events","type":"User","site_admin":false},"body":"Usually when training models with shared parameters, by reflex we share both the `parameters` and the `gradParameters` (if not, `optim` will complain about size mismatches).\r\nBut sharing the `gradParameters` while using an optimization procedure that iterates over the modules (like `updateParameters`, or even Facebook's `nn.Optim' I think) is wrong. See for example https://github.com/torch/nn/issues/395\r\n\r\nAdding it to the docs to make it clearer.","created_at":"2015-10-07T07:56:56Z","updated_at":"2015-10-20T22:37:48Z","closed_at":"2015-10-20T22:37:48Z","merged_at":"2015-10-20T22:37:48Z","merge_commit_sha":"de7deb5164819c6811248d26113eed76a9b012bb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/torch/nn/pulls/422/commits","review_comments_url":"https://api.github.com/repos/torch/nn/pulls/422/comments","review_comment_url":"https://api.github.com/repos/torch/nn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/torch/nn/issues/422/comments","statuses_url":"https://api.github.com/repos/torch/nn/statuses/d2817dca834abaa888422aa3b6eb89614fe6306f","head":{"label":"fmassa:doc_shared_param","ref":"doc_shared_param","sha":"d2817dca834abaa888422aa3b6eb89614fe6306f","user":{"login":"fmassa","id":9110200,"avatar_url":"https://avatars.githubusercontent.com/u/9110200?v=3","gravatar_id":"","url":"https://api.github.com/users/fmassa","html_url":"https://github.com/fmassa","followers_url":"https://api.github.com/users/fmassa/followers","following_url":"https://api.github.com/users/fmassa/following{/other_user}","gists_url":"https://api.github.com/users/fmassa/gists{/gist_id}","starred_url":"https://api.github.com/users/fmassa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmassa/subscriptions","organizations_url":"https://api.github.com/users/fmassa/orgs","repos_url":"https://api.github.com/users/fmassa/repos","events_url":"https://api.github.com/users/fmassa/events{/privacy}","received_events_url":"https://api.github.com/users/fmassa/received_events","type":"User","site_admin":false},"repo":{"id":29308386,"name":"nn","full_name":"fmassa/nn","owner":{"login":"fmassa","id":9110200,"avatar_url":"https://avatars.githubusercontent.com/u/9110200?v=3","gravatar_id":"","url":"https://api.github.com/users/fmassa","html_url":"https://github.com/fmassa","followers_url":"https://api.github.com/users/fmassa/followers","following_url":"https://api.github.com/users/fmassa/following{/other_user}","gists_url":"https://api.github.com/users/fmassa/gists{/gist_id}","starred_url":"https://api.github.com/users/fmassa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmassa/subscriptions","organizations_url":"https://api.github.com/users/fmassa/orgs","repos_url":"https://api.github.com/users/fmassa/repos","events_url":"https://api.github.com/users/fmassa/events{/privacy}","received_events_url":"https://api.github.com/users/fmassa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fmassa/nn","description":"","fork":true,"url":"https://api.github.com/repos/fmassa/nn","forks_url":"https://api.github.com/repos/fmassa/nn/forks","keys_url":"https://api.github.com/repos/fmassa/nn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fmassa/nn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fmassa/nn/teams","hooks_url":"https://api.github.com/repos/fmassa/nn/hooks","issue_events_url":"https://api.github.com/repos/fmassa/nn/issues/events{/number}","events_url":"https://api.github.com/repos/fmassa/nn/events","assignees_url":"https://api.github.com/repos/fmassa/nn/assignees{/user}","branches_url":"https://api.github.com/repos/fmassa/nn/branches{/branch}","tags_url":"https://api.github.com/repos/fmassa/nn/tags","blobs_url":"https://api.github.com/repos/fmassa/nn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fmassa/nn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fmassa/nn/git/refs{/sha}","trees_url":"https://api.github.com/repos/fmassa/nn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fmassa/nn/statuses/{sha}","languages_url":"https://api.github.com/repos/fmassa/nn/languages","stargazers_url":"https://api.github.com/repos/fmassa/nn/stargazers","contributors_url":"https://api.github.com/repos/fmassa/nn/contributors","subscribers_url":"https://api.github.com/repos/fmassa/nn/subscribers","subscription_url":"https://api.github.com/repos/fmassa/nn/subscription","commits_url":"https://api.github.com/repos/fmassa/nn/commits{/sha}","git_commits_url":"https://api.github.com/repos/fmassa/nn/git/commits{/sha}","comments_url":"https://api.github.com/repos/fmassa/nn/comments{/number}","issue_comment_url":"https://api.github.com/repos/fmassa/nn/issues/comments{/number}","contents_url":"https://api.github.com/repos/fmassa/nn/contents/{+path}","compare_url":"https://api.github.com/repos/fmassa/nn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fmassa/nn/merges","archive_url":"https://api.github.com/repos/fmassa/nn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fmassa/nn/downloads","issues_url":"https://api.github.com/repos/fmassa/nn/issues{/number}","pulls_url":"https://api.github.com/repos/fmassa/nn/pulls{/number}","milestones_url":"https://api.github.com/repos/fmassa/nn/milestones{/number}","notifications_url":"https://api.github.com/repos/fmassa/nn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fmassa/nn/labels{/name}","releases_url":"https://api.github.com/repos/fmassa/nn/releases{/id}","created_at":"2015-01-15T17:14:08Z","updated_at":"2015-05-07T16:28:58Z","pushed_at":"2015-10-20T22:07:49Z","git_url":"git://github.com/fmassa/nn.git","ssh_url":"git@github.com:fmassa/nn.git","clone_url":"https://github.com/fmassa/nn.git","svn_url":"https://github.com/fmassa/nn","homepage":null,"size":1829,"stargazers_count":0,"watchers_count":0,"language":"Lua","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"torch:master","ref":"master","sha":"a17572917ba11a1ff40ba8763c638e76e92df701","user":{"login":"torch","id":4978924,"avatar_url":"https://avatars.githubusercontent.com/u/4978924?v=3","gravatar_id":"","url":"https://api.github.com/users/torch","html_url":"https://github.com/torch","followers_url":"https://api.github.com/users/torch/followers","following_url":"https://api.github.com/users/torch/following{/other_user}","gists_url":"https://api.github.com/users/torch/gists{/gist_id}","starred_url":"https://api.github.com/users/torch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torch/subscriptions","organizations_url":"https://api.github.com/users/torch/orgs","repos_url":"https://api.github.com/users/torch/repos","events_url":"https://api.github.com/users/torch/events{/privacy}","received_events_url":"https://api.github.com/users/torch/received_events","type":"Organization","site_admin":false},"repo":{"id":13677447,"name":"nn","full_name":"torch/nn","owner":{"login":"torch","id":4978924,"avatar_url":"https://avatars.githubusercontent.com/u/4978924?v=3","gravatar_id":"","url":"https://api.github.com/users/torch","html_url":"https://github.com/torch","followers_url":"https://api.github.com/users/torch/followers","following_url":"https://api.github.com/users/torch/following{/other_user}","gists_url":"https://api.github.com/users/torch/gists{/gist_id}","starred_url":"https://api.github.com/users/torch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torch/subscriptions","organizations_url":"https://api.github.com/users/torch/orgs","repos_url":"https://api.github.com/users/torch/repos","events_url":"https://api.github.com/users/torch/events{/privacy}","received_events_url":"https://api.github.com/users/torch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/torch/nn","description":"","fork":false,"url":"https://api.github.com/repos/torch/nn","forks_url":"https://api.github.com/repos/torch/nn/forks","keys_url":"https://api.github.com/repos/torch/nn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/torch/nn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/torch/nn/teams","hooks_url":"https://api.github.com/repos/torch/nn/hooks","issue_events_url":"https://api.github.com/repos/torch/nn/issues/events{/number}","events_url":"https://api.github.com/repos/torch/nn/events","assignees_url":"https://api.github.com/repos/torch/nn/assignees{/user}","branches_url":"https://api.github.com/repos/torch/nn/branches{/branch}","tags_url":"https://api.github.com/repos/torch/nn/tags","blobs_url":"https://api.github.com/repos/torch/nn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/torch/nn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/torch/nn/git/refs{/sha}","trees_url":"https://api.github.com/repos/torch/nn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/torch/nn/statuses/{sha}","languages_url":"https://api.github.com/repos/torch/nn/languages","stargazers_url":"https://api.github.com/repos/torch/nn/stargazers","contributors_url":"https://api.github.com/repos/torch/nn/contributors","subscribers_url":"https://api.github.com/repos/torch/nn/subscribers","subscription_url":"https://api.github.com/repos/torch/nn/subscription","commits_url":"https://api.github.com/repos/torch/nn/commits{/sha}","git_commits_url":"https://api.github.com/repos/torch/nn/git/commits{/sha}","comments_url":"https://api.github.com/repos/torch/nn/comments{/number}","issue_comment_url":"https://api.github.com/repos/torch/nn/issues/comments{/number}","contents_url":"https://api.github.com/repos/torch/nn/contents/{+path}","compare_url":"https://api.github.com/repos/torch/nn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/torch/nn/merges","archive_url":"https://api.github.com/repos/torch/nn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/torch/nn/downloads","issues_url":"https://api.github.com/repos/torch/nn/issues{/number}","pulls_url":"https://api.github.com/repos/torch/nn/pulls{/number}","milestones_url":"https://api.github.com/repos/torch/nn/milestones{/number}","notifications_url":"https://api.github.com/repos/torch/nn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/torch/nn/labels{/name}","releases_url":"https://api.github.com/repos/torch/nn/releases{/id}","created_at":"2013-10-18T12:27:25Z","updated_at":"2015-10-20T10:11:21Z","pushed_at":"2015-10-20T22:37:48Z","git_url":"git://github.com/torch/nn.git","ssh_url":"git@github.com:torch/nn.git","clone_url":"https://github.com/torch/nn.git","svn_url":"https://github.com/torch/nn","homepage":"","size":4121,"stargazers_count":299,"watchers_count":299,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":240,"mirror_url":null,"open_issues_count":31,"forks":240,"open_issues":31,"watchers":299,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/torch/nn/pulls/422"},"html":{"href":"https://github.com/torch/nn/pull/422"},"issue":{"href":"https://api.github.com/repos/torch/nn/issues/422"},"comments":{"href":"https://api.github.com/repos/torch/nn/issues/422/comments"},"review_comments":{"href":"https://api.github.com/repos/torch/nn/pulls/422/comments"},"review_comment":{"href":"https://api.github.com/repos/torch/nn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/torch/nn/pulls/422/commits"},"statuses":{"href":"https://api.github.com/repos/torch/nn/statuses/d2817dca834abaa888422aa3b6eb89614fe6306f"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"soumith","id":1310570,"avatar_url":"https://avatars.githubusercontent.com/u/1310570?v=3","gravatar_id":"","url":"https://api.github.com/users/soumith","html_url":"https://github.com/soumith","followers_url":"https://api.github.com/users/soumith/followers","following_url":"https://api.github.com/users/soumith/following{/other_user}","gists_url":"https://api.github.com/users/soumith/gists{/gist_id}","starred_url":"https://api.github.com/users/soumith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soumith/subscriptions","organizations_url":"https://api.github.com/users/soumith/orgs","repos_url":"https://api.github.com/users/soumith/repos","events_url":"https://api.github.com/users/soumith/events{/privacy}","received_events_url":"https://api.github.com/users/soumith/received_events","type":"User","site_admin":false},"comments":1,"review_comments":3,"commits":1,"additions":59,"deletions":1,"changed_files":1}}