{"action":"created","comment":{"url":"https://api.github.com/repos/allenai/ml/pulls/comments/30184378","id":30184378,"diff_hunk":"@@ -87,5 +89,5 @@ public double dotProduct(Vector other) {\n           result += val * other.at(idx);","path":"src/main/java/com/allenai/ml/linalg/SparseVector.java","position":114,"original_position":114,"commit_id":"6070ba3aeb9666e4235a3586134cae4d3d572523","original_commit_id":"6070ba3aeb9666e4235a3586134cae4d3d572523","user":{"login":"jakemannix","id":69129,"avatar_url":"https://avatars.githubusercontent.com/u/69129?v=3","gravatar_id":"","url":"https://api.github.com/users/jakemannix","html_url":"https://github.com/jakemannix","followers_url":"https://api.github.com/users/jakemannix/followers","following_url":"https://api.github.com/users/jakemannix/following{/other_user}","gists_url":"https://api.github.com/users/jakemannix/gists{/gist_id}","starred_url":"https://api.github.com/users/jakemannix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakemannix/subscriptions","organizations_url":"https://api.github.com/users/jakemannix/orgs","repos_url":"https://api.github.com/users/jakemannix/repos","events_url":"https://api.github.com/users/jakemannix/events{/privacy}","received_events_url":"https://api.github.com/users/jakemannix/received_events","type":"User","site_admin":false},"body":"perf question: you said this was backed by long[]  + double[], right?  So this dot product is iterating over the smaller vector (array iteration, fast), but doing lookups into the other one - so log(numStoredEntries) binary search per entry, for a total cost of smaller.numStoredEntries() * log(larger.numStoredEntries()), right?  Should be able to be done linearly if you iterate in parallel, no?","created_at":"2015-05-12T21:49:20Z","updated_at":"2015-05-12T21:49:20Z","html_url":"https://github.com/allenai/ml/pull/6#discussion_r30184378","pull_request_url":"https://api.github.com/repos/allenai/ml/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/allenai/ml/pulls/comments/30184378"},"html":{"href":"https://github.com/allenai/ml/pull/6#discussion_r30184378"},"pull_request":{"href":"https://api.github.com/repos/allenai/ml/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/allenai/ml/pulls/6","id":35250381,"html_url":"https://github.com/allenai/ml/pull/6","diff_url":"https://github.com/allenai/ml/pull/6.diff","patch_url":"https://github.com/allenai/ml/pull/6.patch","issue_url":"https://api.github.com/repos/allenai/ml/issues/6","number":6,"state":"open","locked":false,"title":"Added support for marginals to forwards-backward and CRF weight encoding","user":{"login":"aria42","id":31170,"avatar_url":"https://avatars.githubusercontent.com/u/31170?v=3","gravatar_id":"","url":"https://api.github.com/users/aria42","html_url":"https://github.com/aria42","followers_url":"https://api.github.com/users/aria42/followers","following_url":"https://api.github.com/users/aria42/following{/other_user}","gists_url":"https://api.github.com/users/aria42/gists{/gist_id}","starred_url":"https://api.github.com/users/aria42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aria42/subscriptions","organizations_url":"https://api.github.com/users/aria42/orgs","repos_url":"https://api.github.com/users/aria42/repos","events_url":"https://api.github.com/users/aria42/events{/privacy}","received_events_url":"https://api.github.com/users/aria42/received_events","type":"User","site_admin":false},"body":"This pull does a few related things\r\n\r\n* Support for node and edge clique marginals in `ForwardsBackwards`; required for log-likelihood training. CRF++ does Mira based `max` training, but despite being slower, I prefer deterministic log-likelihood training which has some advantages.\r\n* `CRFIndexedExample` class which is a compact memory-efficient representation of the active predicates (feature templates) on the node/edge cliques. From prior experience, you lose a lot in performance if each example has object overhead per clique instead of flattening them out. \r\n* `CRFWeightEncoder` which knows how to take CRF parameters to populate a potential matrix for use by `ForwardBackwards`\r\n\r\nGiven the above pieces, I have another PR, I'm trying to keep each around 500-700 lines of diff, which will actually implement the likelihood objective given the above pieces and then I can add a `Main`-class which glues all the pieces together. \r\n\r\n__Testing Coverage__: \r\n![screen shot 2015-05-12 at 10 28 33 am](https://cloud.githubusercontent.com/assets/31170/7593827/ac000f6a-f891-11e4-9aac-78f1db57af71.png)\r\n","created_at":"2015-05-12T17:28:55Z","updated_at":"2015-05-12T21:49:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9fe946ce7a2a78df86a4bcd0b7eb85db65ae9e1","assignee":{"login":"jakemannix","id":69129,"avatar_url":"https://avatars.githubusercontent.com/u/69129?v=3","gravatar_id":"","url":"https://api.github.com/users/jakemannix","html_url":"https://github.com/jakemannix","followers_url":"https://api.github.com/users/jakemannix/followers","following_url":"https://api.github.com/users/jakemannix/following{/other_user}","gists_url":"https://api.github.com/users/jakemannix/gists{/gist_id}","starred_url":"https://api.github.com/users/jakemannix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakemannix/subscriptions","organizations_url":"https://api.github.com/users/jakemannix/orgs","repos_url":"https://api.github.com/users/jakemannix/repos","events_url":"https://api.github.com/users/jakemannix/events{/privacy}","received_events_url":"https://api.github.com/users/jakemannix/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/allenai/ml/pulls/6/commits","review_comments_url":"https://api.github.com/repos/allenai/ml/pulls/6/comments","review_comment_url":"https://api.github.com/repos/allenai/ml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/allenai/ml/issues/6/comments","statuses_url":"https://api.github.com/repos/allenai/ml/statuses/6070ba3aeb9666e4235a3586134cae4d3d572523","head":{"label":"allenai:origin/ariah/crf-potential-filler","ref":"origin/ariah/crf-potential-filler","sha":"6070ba3aeb9666e4235a3586134cae4d3d572523","user":{"login":"allenai","id":5667695,"avatar_url":"https://avatars.githubusercontent.com/u/5667695?v=3","gravatar_id":"","url":"https://api.github.com/users/allenai","html_url":"https://github.com/allenai","followers_url":"https://api.github.com/users/allenai/followers","following_url":"https://api.github.com/users/allenai/following{/other_user}","gists_url":"https://api.github.com/users/allenai/gists{/gist_id}","starred_url":"https://api.github.com/users/allenai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenai/subscriptions","organizations_url":"https://api.github.com/users/allenai/orgs","repos_url":"https://api.github.com/users/allenai/repos","events_url":"https://api.github.com/users/allenai/events{/privacy}","received_events_url":"https://api.github.com/users/allenai/received_events","type":"Organization","site_admin":false},"repo":{"id":35112898,"name":"ml","full_name":"allenai/ml","owner":{"login":"allenai","id":5667695,"avatar_url":"https://avatars.githubusercontent.com/u/5667695?v=3","gravatar_id":"","url":"https://api.github.com/users/allenai","html_url":"https://github.com/allenai","followers_url":"https://api.github.com/users/allenai/followers","following_url":"https://api.github.com/users/allenai/following{/other_user}","gists_url":"https://api.github.com/users/allenai/gists{/gist_id}","starred_url":"https://api.github.com/users/allenai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenai/subscriptions","organizations_url":"https://api.github.com/users/allenai/orgs","repos_url":"https://api.github.com/users/allenai/repos","events_url":"https://api.github.com/users/allenai/events{/privacy}","received_events_url":"https://api.github.com/users/allenai/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/allenai/ml","description":"Re-usable low-level ML components","fork":false,"url":"https://api.github.com/repos/allenai/ml","forks_url":"https://api.github.com/repos/allenai/ml/forks","keys_url":"https://api.github.com/repos/allenai/ml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allenai/ml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allenai/ml/teams","hooks_url":"https://api.github.com/repos/allenai/ml/hooks","issue_events_url":"https://api.github.com/repos/allenai/ml/issues/events{/number}","events_url":"https://api.github.com/repos/allenai/ml/events","assignees_url":"https://api.github.com/repos/allenai/ml/assignees{/user}","branches_url":"https://api.github.com/repos/allenai/ml/branches{/branch}","tags_url":"https://api.github.com/repos/allenai/ml/tags","blobs_url":"https://api.github.com/repos/allenai/ml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allenai/ml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allenai/ml/git/refs{/sha}","trees_url":"https://api.github.com/repos/allenai/ml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allenai/ml/statuses/{sha}","languages_url":"https://api.github.com/repos/allenai/ml/languages","stargazers_url":"https://api.github.com/repos/allenai/ml/stargazers","contributors_url":"https://api.github.com/repos/allenai/ml/contributors","subscribers_url":"https://api.github.com/repos/allenai/ml/subscribers","subscription_url":"https://api.github.com/repos/allenai/ml/subscription","commits_url":"https://api.github.com/repos/allenai/ml/commits{/sha}","git_commits_url":"https://api.github.com/repos/allenai/ml/git/commits{/sha}","comments_url":"https://api.github.com/repos/allenai/ml/comments{/number}","issue_comment_url":"https://api.github.com/repos/allenai/ml/issues/comments{/number}","contents_url":"https://api.github.com/repos/allenai/ml/contents/{+path}","compare_url":"https://api.github.com/repos/allenai/ml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allenai/ml/merges","archive_url":"https://api.github.com/repos/allenai/ml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allenai/ml/downloads","issues_url":"https://api.github.com/repos/allenai/ml/issues{/number}","pulls_url":"https://api.github.com/repos/allenai/ml/pulls{/number}","milestones_url":"https://api.github.com/repos/allenai/ml/milestones{/number}","notifications_url":"https://api.github.com/repos/allenai/ml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allenai/ml/labels{/name}","releases_url":"https://api.github.com/repos/allenai/ml/releases{/id}","created_at":"2015-05-05T17:05:28Z","updated_at":"2015-05-07T20:48:24Z","pushed_at":"2015-05-12T17:28:55Z","git_url":"git://github.com/allenai/ml.git","ssh_url":"git@github.com:allenai/ml.git","clone_url":"https://github.com/allenai/ml.git","svn_url":"https://github.com/allenai/ml","homepage":null,"size":292,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"allenai:master","ref":"master","sha":"1d1a94feb3d864cb84f6fd2487b0c634dff89e27","user":{"login":"allenai","id":5667695,"avatar_url":"https://avatars.githubusercontent.com/u/5667695?v=3","gravatar_id":"","url":"https://api.github.com/users/allenai","html_url":"https://github.com/allenai","followers_url":"https://api.github.com/users/allenai/followers","following_url":"https://api.github.com/users/allenai/following{/other_user}","gists_url":"https://api.github.com/users/allenai/gists{/gist_id}","starred_url":"https://api.github.com/users/allenai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenai/subscriptions","organizations_url":"https://api.github.com/users/allenai/orgs","repos_url":"https://api.github.com/users/allenai/repos","events_url":"https://api.github.com/users/allenai/events{/privacy}","received_events_url":"https://api.github.com/users/allenai/received_events","type":"Organization","site_admin":false},"repo":{"id":35112898,"name":"ml","full_name":"allenai/ml","owner":{"login":"allenai","id":5667695,"avatar_url":"https://avatars.githubusercontent.com/u/5667695?v=3","gravatar_id":"","url":"https://api.github.com/users/allenai","html_url":"https://github.com/allenai","followers_url":"https://api.github.com/users/allenai/followers","following_url":"https://api.github.com/users/allenai/following{/other_user}","gists_url":"https://api.github.com/users/allenai/gists{/gist_id}","starred_url":"https://api.github.com/users/allenai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenai/subscriptions","organizations_url":"https://api.github.com/users/allenai/orgs","repos_url":"https://api.github.com/users/allenai/repos","events_url":"https://api.github.com/users/allenai/events{/privacy}","received_events_url":"https://api.github.com/users/allenai/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/allenai/ml","description":"Re-usable low-level ML components","fork":false,"url":"https://api.github.com/repos/allenai/ml","forks_url":"https://api.github.com/repos/allenai/ml/forks","keys_url":"https://api.github.com/repos/allenai/ml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allenai/ml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allenai/ml/teams","hooks_url":"https://api.github.com/repos/allenai/ml/hooks","issue_events_url":"https://api.github.com/repos/allenai/ml/issues/events{/number}","events_url":"https://api.github.com/repos/allenai/ml/events","assignees_url":"https://api.github.com/repos/allenai/ml/assignees{/user}","branches_url":"https://api.github.com/repos/allenai/ml/branches{/branch}","tags_url":"https://api.github.com/repos/allenai/ml/tags","blobs_url":"https://api.github.com/repos/allenai/ml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allenai/ml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allenai/ml/git/refs{/sha}","trees_url":"https://api.github.com/repos/allenai/ml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allenai/ml/statuses/{sha}","languages_url":"https://api.github.com/repos/allenai/ml/languages","stargazers_url":"https://api.github.com/repos/allenai/ml/stargazers","contributors_url":"https://api.github.com/repos/allenai/ml/contributors","subscribers_url":"https://api.github.com/repos/allenai/ml/subscribers","subscription_url":"https://api.github.com/repos/allenai/ml/subscription","commits_url":"https://api.github.com/repos/allenai/ml/commits{/sha}","git_commits_url":"https://api.github.com/repos/allenai/ml/git/commits{/sha}","comments_url":"https://api.github.com/repos/allenai/ml/comments{/number}","issue_comment_url":"https://api.github.com/repos/allenai/ml/issues/comments{/number}","contents_url":"https://api.github.com/repos/allenai/ml/contents/{+path}","compare_url":"https://api.github.com/repos/allenai/ml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allenai/ml/merges","archive_url":"https://api.github.com/repos/allenai/ml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allenai/ml/downloads","issues_url":"https://api.github.com/repos/allenai/ml/issues{/number}","pulls_url":"https://api.github.com/repos/allenai/ml/pulls{/number}","milestones_url":"https://api.github.com/repos/allenai/ml/milestones{/number}","notifications_url":"https://api.github.com/repos/allenai/ml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allenai/ml/labels{/name}","releases_url":"https://api.github.com/repos/allenai/ml/releases{/id}","created_at":"2015-05-05T17:05:28Z","updated_at":"2015-05-07T20:48:24Z","pushed_at":"2015-05-12T17:28:55Z","git_url":"git://github.com/allenai/ml.git","ssh_url":"git@github.com:allenai/ml.git","clone_url":"https://github.com/allenai/ml.git","svn_url":"https://github.com/allenai/ml","homepage":null,"size":292,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/allenai/ml/pulls/6"},"html":{"href":"https://github.com/allenai/ml/pull/6"},"issue":{"href":"https://api.github.com/repos/allenai/ml/issues/6"},"comments":{"href":"https://api.github.com/repos/allenai/ml/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/allenai/ml/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/allenai/ml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/allenai/ml/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/allenai/ml/statuses/6070ba3aeb9666e4235a3586134cae4d3d572523"}}}}