{"action":"created","comment":{"url":"https://api.github.com/repos/kaldi-asr/kaldi/pulls/comments/43796326","id":43796326,"diff_hunk":"@@ -309,6 +310,7 @@ class AffineComponent: public UpdatableComponent {\n   Component *CollapseWithNext(const FixedAffineComponent &next) const;","path":"src/nnet3/nnet-simple-component.h","position":9,"original_position":9,"commit_id":"b3e85f41abc5e5279777fb1425f0e6af3eeea117","original_commit_id":"b3e85f41abc5e5279777fb1425f0e6af3eeea117","user":{"login":"danpovey","id":3298747,"avatar_url":"https://avatars.githubusercontent.com/u/3298747?v=3","gravatar_id":"","url":"https://api.github.com/users/danpovey","html_url":"https://github.com/danpovey","followers_url":"https://api.github.com/users/danpovey/followers","following_url":"https://api.github.com/users/danpovey/following{/other_user}","gists_url":"https://api.github.com/users/danpovey/gists{/gist_id}","starred_url":"https://api.github.com/users/danpovey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danpovey/subscriptions","organizations_url":"https://api.github.com/users/danpovey/orgs","repos_url":"https://api.github.com/users/danpovey/repos","events_url":"https://api.github.com/users/danpovey/events{/privacy}","received_events_url":"https://api.github.com/users/danpovey/received_events","type":"User","site_admin":false},"body":"That looks right, from a quick look.\nYes you should fix that.\n\nOn Tue, Nov 3, 2015 at 2:33 PM, hhadian <notifications@github.com> wrote:\n\n> In src/nnet3/nnet-simple-component.h\n> <https://github.com/kaldi-asr/kaldi/pull/307#discussion_r43795463>:\n>\n> > @@ -309,6 +310,7 @@ class AffineComponent: public UpdatableComponent {\n> >    Component *CollapseWithNext(const FixedAffineComponent &next) const;\n>\n> About the second part, I'm not sure how to check Scale(), SetZero(), and\n> Add(). This is the code I have come up with:\n> void TestNnetComponentVectorizeUnVectorize(Component\n> *c) { UpdatableComponent *uc = dynamic_cast<UpdatableComponent*>(c);\n> if((uc==NULL) || (uc->NumParameters() == 0))\n> return;\n> Vector params;\n> UpdatableComponent *uc2 = dynamic_cast<UpdatableComponent*>(uc->Copy());\n> uc2->SetZero(false);\n> uc2->Vectorize(&params);\n> KALDI_ASSERT(params.Min()==0.0 && params.Sum()==0.0);\n> uc->Vectorize(&params);\n> uc2->UnVectorize(params);\n> KALDI_ASSERT(uc2->Info() == uc->Info());\n> KALDI_ASSERT(uc2->DotProduct(*uc2) == uc->DotProduct(*uc));\n> delete uc2;\n> }\n> void TestNnetComponentUpdatableFlag(Component\n> *c) { UpdatableComponent *uc = dynamic_cast<UpdatableComponent*>(c);\n> if(uc==NULL)\n> return;\n> if(!(uc->Properties() & kUpdatableComponent)){\n> KALDI_ASSERT(uc->NumParameters() == 0);\n> KALDI_ASSERT(uc->DotProduct(\n> *uc) == 0); UpdatableComponent *uc2 = dynamic_cast<UpdatableComponent*\n> >(uc->Copy());\n> uc2->Scale(7.0);\n> uc2->Add(3.0, *uc);\n> KALDI_ASSERT(uc2->Info() == uc->Info());\n> uc->SetZero(false);\n> KALDI_ASSERT(uc2->Info() == uc->Info());\n> delete uc2;\n> }\n> }\n>\n> Also this test caused Convolutional1dComponent to fail in Vectorize test\n> because it does not implement it. Should I fix that too?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/kaldi-asr/kaldi/pull/307/files#r43795463>.\n>\n","created_at":"2015-11-03T19:39:20Z","updated_at":"2015-11-03T19:39:20Z","html_url":"https://github.com/kaldi-asr/kaldi/pull/307#discussion_r43796326","pull_request_url":"https://api.github.com/repos/kaldi-asr/kaldi/pulls/307","_links":{"self":{"href":"https://api.github.com/repos/kaldi-asr/kaldi/pulls/comments/43796326"},"html":{"href":"https://github.com/kaldi-asr/kaldi/pull/307#discussion_r43796326"},"pull_request":{"href":"https://api.github.com/repos/kaldi-asr/kaldi/pulls/307"}}},"pull_request":{"url":"https://api.github.com/repos/kaldi-asr/kaldi/pulls/307","id":49377671,"html_url":"https://github.com/kaldi-asr/kaldi/pull/307","diff_url":"https://github.com/kaldi-asr/kaldi/pull/307.diff","patch_url":"https://github.com/kaldi-asr/kaldi/pull/307.patch","issue_url":"https://api.github.com/repos/kaldi-asr/kaldi/issues/307","number":307,"state":"open","locked":false,"title":"Adding PerElementOffsetComponent to nnet3","user":{"login":"hhadian","id":15056653,"avatar_url":"https://avatars.githubusercontent.com/u/15056653?v=3","gravatar_id":"","url":"https://api.github.com/users/hhadian","html_url":"https://github.com/hhadian","followers_url":"https://api.github.com/users/hhadian/followers","following_url":"https://api.github.com/users/hhadian/following{/other_user}","gists_url":"https://api.github.com/users/hhadian/gists{/gist_id}","starred_url":"https://api.github.com/users/hhadian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhadian/subscriptions","organizations_url":"https://api.github.com/users/hhadian/orgs","repos_url":"https://api.github.com/users/hhadian/repos","events_url":"https://api.github.com/users/hhadian/events{/privacy}","received_events_url":"https://api.github.com/users/hhadian/received_events","type":"User","site_admin":false},"body":"I'm not sure if everything is logically correct. Particularly CollapseWithNext  and parameter updates. ","created_at":"2015-11-01T18:40:26Z","updated_at":"2015-11-03T19:39:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"567a64753a139f543d5fa08160430895a06a5ee6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kaldi-asr/kaldi/pulls/307/commits","review_comments_url":"https://api.github.com/repos/kaldi-asr/kaldi/pulls/307/comments","review_comment_url":"https://api.github.com/repos/kaldi-asr/kaldi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kaldi-asr/kaldi/issues/307/comments","statuses_url":"https://api.github.com/repos/kaldi-asr/kaldi/statuses/b3e85f41abc5e5279777fb1425f0e6af3eeea117","head":{"label":"hhadian:master","ref":"master","sha":"b3e85f41abc5e5279777fb1425f0e6af3eeea117","user":{"login":"hhadian","id":15056653,"avatar_url":"https://avatars.githubusercontent.com/u/15056653?v=3","gravatar_id":"","url":"https://api.github.com/users/hhadian","html_url":"https://github.com/hhadian","followers_url":"https://api.github.com/users/hhadian/followers","following_url":"https://api.github.com/users/hhadian/following{/other_user}","gists_url":"https://api.github.com/users/hhadian/gists{/gist_id}","starred_url":"https://api.github.com/users/hhadian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhadian/subscriptions","organizations_url":"https://api.github.com/users/hhadian/orgs","repos_url":"https://api.github.com/users/hhadian/repos","events_url":"https://api.github.com/users/hhadian/events{/privacy}","received_events_url":"https://api.github.com/users/hhadian/received_events","type":"User","site_admin":false},"repo":{"id":44244555,"name":"kaldi","full_name":"hhadian/kaldi","owner":{"login":"hhadian","id":15056653,"avatar_url":"https://avatars.githubusercontent.com/u/15056653?v=3","gravatar_id":"","url":"https://api.github.com/users/hhadian","html_url":"https://github.com/hhadian","followers_url":"https://api.github.com/users/hhadian/followers","following_url":"https://api.github.com/users/hhadian/following{/other_user}","gists_url":"https://api.github.com/users/hhadian/gists{/gist_id}","starred_url":"https://api.github.com/users/hhadian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhadian/subscriptions","organizations_url":"https://api.github.com/users/hhadian/orgs","repos_url":"https://api.github.com/users/hhadian/repos","events_url":"https://api.github.com/users/hhadian/events{/privacy}","received_events_url":"https://api.github.com/users/hhadian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hhadian/kaldi","description":"This is now the official location of the Kaldi project.","fork":true,"url":"https://api.github.com/repos/hhadian/kaldi","forks_url":"https://api.github.com/repos/hhadian/kaldi/forks","keys_url":"https://api.github.com/repos/hhadian/kaldi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hhadian/kaldi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hhadian/kaldi/teams","hooks_url":"https://api.github.com/repos/hhadian/kaldi/hooks","issue_events_url":"https://api.github.com/repos/hhadian/kaldi/issues/events{/number}","events_url":"https://api.github.com/repos/hhadian/kaldi/events","assignees_url":"https://api.github.com/repos/hhadian/kaldi/assignees{/user}","branches_url":"https://api.github.com/repos/hhadian/kaldi/branches{/branch}","tags_url":"https://api.github.com/repos/hhadian/kaldi/tags","blobs_url":"https://api.github.com/repos/hhadian/kaldi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hhadian/kaldi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hhadian/kaldi/git/refs{/sha}","trees_url":"https://api.github.com/repos/hhadian/kaldi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hhadian/kaldi/statuses/{sha}","languages_url":"https://api.github.com/repos/hhadian/kaldi/languages","stargazers_url":"https://api.github.com/repos/hhadian/kaldi/stargazers","contributors_url":"https://api.github.com/repos/hhadian/kaldi/contributors","subscribers_url":"https://api.github.com/repos/hhadian/kaldi/subscribers","subscription_url":"https://api.github.com/repos/hhadian/kaldi/subscription","commits_url":"https://api.github.com/repos/hhadian/kaldi/commits{/sha}","git_commits_url":"https://api.github.com/repos/hhadian/kaldi/git/commits{/sha}","comments_url":"https://api.github.com/repos/hhadian/kaldi/comments{/number}","issue_comment_url":"https://api.github.com/repos/hhadian/kaldi/issues/comments{/number}","contents_url":"https://api.github.com/repos/hhadian/kaldi/contents/{+path}","compare_url":"https://api.github.com/repos/hhadian/kaldi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hhadian/kaldi/merges","archive_url":"https://api.github.com/repos/hhadian/kaldi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hhadian/kaldi/downloads","issues_url":"https://api.github.com/repos/hhadian/kaldi/issues{/number}","pulls_url":"https://api.github.com/repos/hhadian/kaldi/pulls{/number}","milestones_url":"https://api.github.com/repos/hhadian/kaldi/milestones{/number}","notifications_url":"https://api.github.com/repos/hhadian/kaldi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hhadian/kaldi/labels{/name}","releases_url":"https://api.github.com/repos/hhadian/kaldi/releases{/id}","created_at":"2015-10-14T11:55:09Z","updated_at":"2015-10-14T11:55:22Z","pushed_at":"2015-11-02T18:46:09Z","git_url":"git://github.com/hhadian/kaldi.git","ssh_url":"git@github.com:hhadian/kaldi.git","clone_url":"https://github.com/hhadian/kaldi.git","svn_url":"https://github.com/hhadian/kaldi","homepage":"http://kaldi-asr.org","size":73218,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"kaldi-asr:master","ref":"master","sha":"0dcf70946dadac0a608ad2026c084e47ecae8d4a","user":{"login":"kaldi-asr","id":11650082,"avatar_url":"https://avatars.githubusercontent.com/u/11650082?v=3","gravatar_id":"","url":"https://api.github.com/users/kaldi-asr","html_url":"https://github.com/kaldi-asr","followers_url":"https://api.github.com/users/kaldi-asr/followers","following_url":"https://api.github.com/users/kaldi-asr/following{/other_user}","gists_url":"https://api.github.com/users/kaldi-asr/gists{/gist_id}","starred_url":"https://api.github.com/users/kaldi-asr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaldi-asr/subscriptions","organizations_url":"https://api.github.com/users/kaldi-asr/orgs","repos_url":"https://api.github.com/users/kaldi-asr/repos","events_url":"https://api.github.com/users/kaldi-asr/events{/privacy}","received_events_url":"https://api.github.com/users/kaldi-asr/received_events","type":"Organization","site_admin":false},"repo":{"id":34275045,"name":"kaldi","full_name":"kaldi-asr/kaldi","owner":{"login":"kaldi-asr","id":11650082,"avatar_url":"https://avatars.githubusercontent.com/u/11650082?v=3","gravatar_id":"","url":"https://api.github.com/users/kaldi-asr","html_url":"https://github.com/kaldi-asr","followers_url":"https://api.github.com/users/kaldi-asr/followers","following_url":"https://api.github.com/users/kaldi-asr/following{/other_user}","gists_url":"https://api.github.com/users/kaldi-asr/gists{/gist_id}","starred_url":"https://api.github.com/users/kaldi-asr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaldi-asr/subscriptions","organizations_url":"https://api.github.com/users/kaldi-asr/orgs","repos_url":"https://api.github.com/users/kaldi-asr/repos","events_url":"https://api.github.com/users/kaldi-asr/events{/privacy}","received_events_url":"https://api.github.com/users/kaldi-asr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kaldi-asr/kaldi","description":"This is now the official location of the Kaldi project.","fork":false,"url":"https://api.github.com/repos/kaldi-asr/kaldi","forks_url":"https://api.github.com/repos/kaldi-asr/kaldi/forks","keys_url":"https://api.github.com/repos/kaldi-asr/kaldi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaldi-asr/kaldi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaldi-asr/kaldi/teams","hooks_url":"https://api.github.com/repos/kaldi-asr/kaldi/hooks","issue_events_url":"https://api.github.com/repos/kaldi-asr/kaldi/issues/events{/number}","events_url":"https://api.github.com/repos/kaldi-asr/kaldi/events","assignees_url":"https://api.github.com/repos/kaldi-asr/kaldi/assignees{/user}","branches_url":"https://api.github.com/repos/kaldi-asr/kaldi/branches{/branch}","tags_url":"https://api.github.com/repos/kaldi-asr/kaldi/tags","blobs_url":"https://api.github.com/repos/kaldi-asr/kaldi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaldi-asr/kaldi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaldi-asr/kaldi/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaldi-asr/kaldi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaldi-asr/kaldi/statuses/{sha}","languages_url":"https://api.github.com/repos/kaldi-asr/kaldi/languages","stargazers_url":"https://api.github.com/repos/kaldi-asr/kaldi/stargazers","contributors_url":"https://api.github.com/repos/kaldi-asr/kaldi/contributors","subscribers_url":"https://api.github.com/repos/kaldi-asr/kaldi/subscribers","subscription_url":"https://api.github.com/repos/kaldi-asr/kaldi/subscription","commits_url":"https://api.github.com/repos/kaldi-asr/kaldi/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaldi-asr/kaldi/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaldi-asr/kaldi/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaldi-asr/kaldi/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaldi-asr/kaldi/contents/{+path}","compare_url":"https://api.github.com/repos/kaldi-asr/kaldi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaldi-asr/kaldi/merges","archive_url":"https://api.github.com/repos/kaldi-asr/kaldi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaldi-asr/kaldi/downloads","issues_url":"https://api.github.com/repos/kaldi-asr/kaldi/issues{/number}","pulls_url":"https://api.github.com/repos/kaldi-asr/kaldi/pulls{/number}","milestones_url":"https://api.github.com/repos/kaldi-asr/kaldi/milestones{/number}","notifications_url":"https://api.github.com/repos/kaldi-asr/kaldi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaldi-asr/kaldi/labels{/name}","releases_url":"https://api.github.com/repos/kaldi-asr/kaldi/releases{/id}","created_at":"2015-04-20T17:23:16Z","updated_at":"2015-11-03T17:07:56Z","pushed_at":"2015-11-03T03:31:58Z","git_url":"git://github.com/kaldi-asr/kaldi.git","ssh_url":"git@github.com:kaldi-asr/kaldi.git","clone_url":"https://github.com/kaldi-asr/kaldi.git","svn_url":"https://github.com/kaldi-asr/kaldi","homepage":"http://kaldi-asr.org","size":77365,"stargazers_count":261,"watchers_count":261,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":165,"mirror_url":null,"open_issues_count":20,"forks":165,"open_issues":20,"watchers":261,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kaldi-asr/kaldi/pulls/307"},"html":{"href":"https://github.com/kaldi-asr/kaldi/pull/307"},"issue":{"href":"https://api.github.com/repos/kaldi-asr/kaldi/issues/307"},"comments":{"href":"https://api.github.com/repos/kaldi-asr/kaldi/issues/307/comments"},"review_comments":{"href":"https://api.github.com/repos/kaldi-asr/kaldi/pulls/307/comments"},"review_comment":{"href":"https://api.github.com/repos/kaldi-asr/kaldi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kaldi-asr/kaldi/pulls/307/commits"},"statuses":{"href":"https://api.github.com/repos/kaldi-asr/kaldi/statuses/b3e85f41abc5e5279777fb1425f0e6af3eeea117"}}}}