{"action":"created","comment":{"url":"https://api.github.com/repos/tensorflow/magenta/pulls/comments/84719349","pull_request_review_id":5479160,"id":84719349,"diff_hunk":"@@ -361,19 +365,23 @@ def events_to_input(self, events, position):\n       else:\n         melody_event = events[lookback_position]\n       index = self.melody_event_to_index(melody_event)\n-      input_[i * self.num_melody_events + index] = 1.0\n+      input_[(i + 1) * self.num_melody_events + index] = 1.0\n+\n+    num_lookbacks = len(self._lookback_distances)\n \n     # Binary time counter giving the metric location of the *next* note.\n     n = position + 1\n     for i in range(self._binary_counter_bits):\n-      input_[3 * self.num_melody_events + i] = 1.0 if (n / 2 ** i) % 2 else -1.0\n+      input_[(num_lookbacks + 1) * self.num_melody_events +\n+             i] = 1.0 if (n / 2 ** i) % 2 else -1.0","path":"magenta/music/melody_encoder_decoder.py","position":null,"original_position":40,"commit_id":"0ca1da50710db57e4a1f3d9bc4a9ca7944b1dcc5","original_commit_id":"0e928eb9c3d700ae5589ae6552c6ce03e85109cd","user":{"login":"iansimon","id":1361775,"avatar_url":"https://avatars.githubusercontent.com/u/1361775?v=3","gravatar_id":"","url":"https://api.github.com/users/iansimon","html_url":"https://github.com/iansimon","followers_url":"https://api.github.com/users/iansimon/followers","following_url":"https://api.github.com/users/iansimon/following{/other_user}","gists_url":"https://api.github.com/users/iansimon/gists{/gist_id}","starred_url":"https://api.github.com/users/iansimon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iansimon/subscriptions","organizations_url":"https://api.github.com/users/iansimon/orgs","repos_url":"https://api.github.com/users/iansimon/repos","events_url":"https://api.github.com/users/iansimon/events{/privacy}","received_events_url":"https://api.github.com/users/iansimon/received_events","type":"User","site_admin":false},"body":"Fixed.","created_at":"2016-10-24T15:52:58Z","updated_at":"2016-10-24T15:52:58Z","html_url":"https://github.com/tensorflow/magenta/pull/287#discussion_r84719349","pull_request_url":"https://api.github.com/repos/tensorflow/magenta/pulls/287","_links":{"self":{"href":"https://api.github.com/repos/tensorflow/magenta/pulls/comments/84719349"},"html":{"href":"https://github.com/tensorflow/magenta/pull/287#discussion_r84719349"},"pull_request":{"href":"https://api.github.com/repos/tensorflow/magenta/pulls/287"}}},"pull_request":{"url":"https://api.github.com/repos/tensorflow/magenta/pulls/287","id":90550060,"html_url":"https://github.com/tensorflow/magenta/pull/287","diff_url":"https://github.com/tensorflow/magenta/pull/287.diff","patch_url":"https://github.com/tensorflow/magenta/pull/287.patch","issue_url":"https://api.github.com/repos/tensorflow/magenta/issues/287","number":287,"state":"open","locked":false,"title":"Fix a few bugs in lookback and key-melody encoder-decoders.","user":{"login":"iansimon","id":1361775,"avatar_url":"https://avatars.githubusercontent.com/u/1361775?v=3","gravatar_id":"","url":"https://api.github.com/users/iansimon","html_url":"https://github.com/iansimon","followers_url":"https://api.github.com/users/iansimon/followers","following_url":"https://api.github.com/users/iansimon/following{/other_user}","gists_url":"https://api.github.com/users/iansimon/gists{/gist_id}","starred_url":"https://api.github.com/users/iansimon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iansimon/subscriptions","organizations_url":"https://api.github.com/users/iansimon/orgs","repos_url":"https://api.github.com/users/iansimon/repos","events_url":"https://api.github.com/users/iansimon/events{/privacy}","received_events_url":"https://api.github.com/users/iansimon/received_events","type":"User","site_admin":false},"body":"Fixes the following two bugs:\r\n\r\n1) First lookback one-hot vector is written on top of current note one-hot vector.  What's worse, the test data appears to also reflect the error.\r\n\r\n2) In both lookback and key-melody, some offsets into the input vector are hard-coded instead of being dependent on the number of lookback distances & binary counter bits.","created_at":"2016-10-24T05:06:36Z","updated_at":"2016-10-24T15:52:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b33ee520da90735566698f6772e7759bfa7d685e","assignee":{"login":"adarob","id":1088232,"avatar_url":"https://avatars.githubusercontent.com/u/1088232?v=3","gravatar_id":"","url":"https://api.github.com/users/adarob","html_url":"https://github.com/adarob","followers_url":"https://api.github.com/users/adarob/followers","following_url":"https://api.github.com/users/adarob/following{/other_user}","gists_url":"https://api.github.com/users/adarob/gists{/gist_id}","starred_url":"https://api.github.com/users/adarob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adarob/subscriptions","organizations_url":"https://api.github.com/users/adarob/orgs","repos_url":"https://api.github.com/users/adarob/repos","events_url":"https://api.github.com/users/adarob/events{/privacy}","received_events_url":"https://api.github.com/users/adarob/received_events","type":"User","site_admin":false},"assignees":[{"login":"adarob","id":1088232,"avatar_url":"https://avatars.githubusercontent.com/u/1088232?v=3","gravatar_id":"","url":"https://api.github.com/users/adarob","html_url":"https://github.com/adarob","followers_url":"https://api.github.com/users/adarob/followers","following_url":"https://api.github.com/users/adarob/following{/other_user}","gists_url":"https://api.github.com/users/adarob/gists{/gist_id}","starred_url":"https://api.github.com/users/adarob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adarob/subscriptions","organizations_url":"https://api.github.com/users/adarob/orgs","repos_url":"https://api.github.com/users/adarob/repos","events_url":"https://api.github.com/users/adarob/events{/privacy}","received_events_url":"https://api.github.com/users/adarob/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/tensorflow/magenta/pulls/287/commits","review_comments_url":"https://api.github.com/repos/tensorflow/magenta/pulls/287/comments","review_comment_url":"https://api.github.com/repos/tensorflow/magenta/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tensorflow/magenta/issues/287/comments","statuses_url":"https://api.github.com/repos/tensorflow/magenta/statuses/0ca1da50710db57e4a1f3d9bc4a9ca7944b1dcc5","head":{"label":"iansimon:lookback_fix","ref":"lookback_fix","sha":"0ca1da50710db57e4a1f3d9bc4a9ca7944b1dcc5","user":{"login":"iansimon","id":1361775,"avatar_url":"https://avatars.githubusercontent.com/u/1361775?v=3","gravatar_id":"","url":"https://api.github.com/users/iansimon","html_url":"https://github.com/iansimon","followers_url":"https://api.github.com/users/iansimon/followers","following_url":"https://api.github.com/users/iansimon/following{/other_user}","gists_url":"https://api.github.com/users/iansimon/gists{/gist_id}","starred_url":"https://api.github.com/users/iansimon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iansimon/subscriptions","organizations_url":"https://api.github.com/users/iansimon/orgs","repos_url":"https://api.github.com/users/iansimon/repos","events_url":"https://api.github.com/users/iansimon/events{/privacy}","received_events_url":"https://api.github.com/users/iansimon/received_events","type":"User","site_admin":false},"repo":{"id":65947020,"name":"magenta","full_name":"iansimon/magenta","owner":{"login":"iansimon","id":1361775,"avatar_url":"https://avatars.githubusercontent.com/u/1361775?v=3","gravatar_id":"","url":"https://api.github.com/users/iansimon","html_url":"https://github.com/iansimon","followers_url":"https://api.github.com/users/iansimon/followers","following_url":"https://api.github.com/users/iansimon/following{/other_user}","gists_url":"https://api.github.com/users/iansimon/gists{/gist_id}","starred_url":"https://api.github.com/users/iansimon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iansimon/subscriptions","organizations_url":"https://api.github.com/users/iansimon/orgs","repos_url":"https://api.github.com/users/iansimon/repos","events_url":"https://api.github.com/users/iansimon/events{/privacy}","received_events_url":"https://api.github.com/users/iansimon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iansimon/magenta","description":"Magenta: Music and Art Generation with Machine Intelligence","fork":true,"url":"https://api.github.com/repos/iansimon/magenta","forks_url":"https://api.github.com/repos/iansimon/magenta/forks","keys_url":"https://api.github.com/repos/iansimon/magenta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iansimon/magenta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iansimon/magenta/teams","hooks_url":"https://api.github.com/repos/iansimon/magenta/hooks","issue_events_url":"https://api.github.com/repos/iansimon/magenta/issues/events{/number}","events_url":"https://api.github.com/repos/iansimon/magenta/events","assignees_url":"https://api.github.com/repos/iansimon/magenta/assignees{/user}","branches_url":"https://api.github.com/repos/iansimon/magenta/branches{/branch}","tags_url":"https://api.github.com/repos/iansimon/magenta/tags","blobs_url":"https://api.github.com/repos/iansimon/magenta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iansimon/magenta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iansimon/magenta/git/refs{/sha}","trees_url":"https://api.github.com/repos/iansimon/magenta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iansimon/magenta/statuses/{sha}","languages_url":"https://api.github.com/repos/iansimon/magenta/languages","stargazers_url":"https://api.github.com/repos/iansimon/magenta/stargazers","contributors_url":"https://api.github.com/repos/iansimon/magenta/contributors","subscribers_url":"https://api.github.com/repos/iansimon/magenta/subscribers","subscription_url":"https://api.github.com/repos/iansimon/magenta/subscription","commits_url":"https://api.github.com/repos/iansimon/magenta/commits{/sha}","git_commits_url":"https://api.github.com/repos/iansimon/magenta/git/commits{/sha}","comments_url":"https://api.github.com/repos/iansimon/magenta/comments{/number}","issue_comment_url":"https://api.github.com/repos/iansimon/magenta/issues/comments{/number}","contents_url":"https://api.github.com/repos/iansimon/magenta/contents/{+path}","compare_url":"https://api.github.com/repos/iansimon/magenta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iansimon/magenta/merges","archive_url":"https://api.github.com/repos/iansimon/magenta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iansimon/magenta/downloads","issues_url":"https://api.github.com/repos/iansimon/magenta/issues{/number}","pulls_url":"https://api.github.com/repos/iansimon/magenta/pulls{/number}","milestones_url":"https://api.github.com/repos/iansimon/magenta/milestones{/number}","notifications_url":"https://api.github.com/repos/iansimon/magenta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iansimon/magenta/labels{/name}","releases_url":"https://api.github.com/repos/iansimon/magenta/releases{/id}","deployments_url":"https://api.github.com/repos/iansimon/magenta/deployments","created_at":"2016-08-17T22:39:13Z","updated_at":"2016-08-17T22:39:14Z","pushed_at":"2016-10-24T15:52:34Z","git_url":"git://github.com/iansimon/magenta.git","ssh_url":"git@github.com:iansimon/magenta.git","clone_url":"https://github.com/iansimon/magenta.git","svn_url":"https://github.com/iansimon/magenta","homepage":"","size":11692,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"tensorflow:master","ref":"master","sha":"da877b47050c29ba30dfb8034511ccb1b524af21","user":{"login":"tensorflow","id":15658638,"avatar_url":"https://avatars.githubusercontent.com/u/15658638?v=3","gravatar_id":"","url":"https://api.github.com/users/tensorflow","html_url":"https://github.com/tensorflow","followers_url":"https://api.github.com/users/tensorflow/followers","following_url":"https://api.github.com/users/tensorflow/following{/other_user}","gists_url":"https://api.github.com/users/tensorflow/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflow/subscriptions","organizations_url":"https://api.github.com/users/tensorflow/orgs","repos_url":"https://api.github.com/users/tensorflow/repos","events_url":"https://api.github.com/users/tensorflow/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflow/received_events","type":"Organization","site_admin":false},"repo":{"id":58157629,"name":"magenta","full_name":"tensorflow/magenta","owner":{"login":"tensorflow","id":15658638,"avatar_url":"https://avatars.githubusercontent.com/u/15658638?v=3","gravatar_id":"","url":"https://api.github.com/users/tensorflow","html_url":"https://github.com/tensorflow","followers_url":"https://api.github.com/users/tensorflow/followers","following_url":"https://api.github.com/users/tensorflow/following{/other_user}","gists_url":"https://api.github.com/users/tensorflow/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflow/subscriptions","organizations_url":"https://api.github.com/users/tensorflow/orgs","repos_url":"https://api.github.com/users/tensorflow/repos","events_url":"https://api.github.com/users/tensorflow/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflow/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tensorflow/magenta","description":"Magenta: Music and Art Generation with Machine Intelligence","fork":false,"url":"https://api.github.com/repos/tensorflow/magenta","forks_url":"https://api.github.com/repos/tensorflow/magenta/forks","keys_url":"https://api.github.com/repos/tensorflow/magenta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tensorflow/magenta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tensorflow/magenta/teams","hooks_url":"https://api.github.com/repos/tensorflow/magenta/hooks","issue_events_url":"https://api.github.com/repos/tensorflow/magenta/issues/events{/number}","events_url":"https://api.github.com/repos/tensorflow/magenta/events","assignees_url":"https://api.github.com/repos/tensorflow/magenta/assignees{/user}","branches_url":"https://api.github.com/repos/tensorflow/magenta/branches{/branch}","tags_url":"https://api.github.com/repos/tensorflow/magenta/tags","blobs_url":"https://api.github.com/repos/tensorflow/magenta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tensorflow/magenta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tensorflow/magenta/git/refs{/sha}","trees_url":"https://api.github.com/repos/tensorflow/magenta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tensorflow/magenta/statuses/{sha}","languages_url":"https://api.github.com/repos/tensorflow/magenta/languages","stargazers_url":"https://api.github.com/repos/tensorflow/magenta/stargazers","contributors_url":"https://api.github.com/repos/tensorflow/magenta/contributors","subscribers_url":"https://api.github.com/repos/tensorflow/magenta/subscribers","subscription_url":"https://api.github.com/repos/tensorflow/magenta/subscription","commits_url":"https://api.github.com/repos/tensorflow/magenta/commits{/sha}","git_commits_url":"https://api.github.com/repos/tensorflow/magenta/git/commits{/sha}","comments_url":"https://api.github.com/repos/tensorflow/magenta/comments{/number}","issue_comment_url":"https://api.github.com/repos/tensorflow/magenta/issues/comments{/number}","contents_url":"https://api.github.com/repos/tensorflow/magenta/contents/{+path}","compare_url":"https://api.github.com/repos/tensorflow/magenta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tensorflow/magenta/merges","archive_url":"https://api.github.com/repos/tensorflow/magenta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tensorflow/magenta/downloads","issues_url":"https://api.github.com/repos/tensorflow/magenta/issues{/number}","pulls_url":"https://api.github.com/repos/tensorflow/magenta/pulls{/number}","milestones_url":"https://api.github.com/repos/tensorflow/magenta/milestones{/number}","notifications_url":"https://api.github.com/repos/tensorflow/magenta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tensorflow/magenta/labels{/name}","releases_url":"https://api.github.com/repos/tensorflow/magenta/releases{/id}","deployments_url":"https://api.github.com/repos/tensorflow/magenta/deployments","created_at":"2016-05-05T20:10:40Z","updated_at":"2016-10-24T15:41:24Z","pushed_at":"2016-10-24T15:52:35Z","git_url":"git://github.com/tensorflow/magenta.git","ssh_url":"git@github.com:tensorflow/magenta.git","clone_url":"https://github.com/tensorflow/magenta.git","svn_url":"https://github.com/tensorflow/magenta","homepage":"","size":15698,"stargazers_count":3421,"watchers_count":3421,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":401,"mirror_url":null,"open_issues_count":17,"forks":401,"open_issues":17,"watchers":3421,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tensorflow/magenta/pulls/287"},"html":{"href":"https://github.com/tensorflow/magenta/pull/287"},"issue":{"href":"https://api.github.com/repos/tensorflow/magenta/issues/287"},"comments":{"href":"https://api.github.com/repos/tensorflow/magenta/issues/287/comments"},"review_comments":{"href":"https://api.github.com/repos/tensorflow/magenta/pulls/287/comments"},"review_comment":{"href":"https://api.github.com/repos/tensorflow/magenta/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tensorflow/magenta/pulls/287/commits"},"statuses":{"href":"https://api.github.com/repos/tensorflow/magenta/statuses/0ca1da50710db57e4a1f3d9bc4a9ca7944b1dcc5"}}}}
{"actor":{"display_login":"iansimon"}}