{"action":"created","comment":{"url":"https://api.github.com/repos/project-rig/nengo_spinnaker/pulls/comments/32312198","id":32312198,"diff_hunk":"@@ -253,18 +315,35 @@ def write_subregion_to_file(self, fp, vertex_slice):\n         )\n         fp.write(data)\n \n+PESLearningRule = collections.namedtuple(\n+    \"PESLearningRule\", \"learning_rate, filter_index, decoder_offset\")\n+\n \n class PESRegion(regions.Region):\n     \"\"\"Region representing parameters for PES learning rules.\n     \"\"\"\n-    # TODO Implement PES\n+    def __init__(self):\n+        self.learning_rules = []\n \n     def sizeof(self, *args):\n-        return 4\n+        return 4 + (len(self.learning_rules) * 12)\n \n     def write_subregion_to_file(self, fp, vertex_slice):\n-        # Write out a zero, indicating no PES data\n-        fp.write(b\"\\x00\" * 4)\n+        # Get length of slice for scaling learning rate\n+        n_neurons = float(vertex_slice.stop - vertex_slice.start)\n+\n+        # Write number of learning rules\n+        fp.write(struct.pack(\"<I\", len(self.learning_rules)))\n+\n+        # Write learning rules\n+        for l in self.learning_rules:\n+            data = struct.pack(\n+                \"<iII\",\n+                tp.value_to_fix(l.learning_rate / n_neurons),","path":"nengo_spinnaker/operators/lif.py","position":144,"original_position":144,"commit_id":"4d97368a7bdfa84e3504590fad9583d29a2a5f3d","original_commit_id":"4d97368a7bdfa84e3504590fad9583d29a2a5f3d","user":{"login":"neworderofjamie","id":6793242,"avatar_url":"https://avatars.githubusercontent.com/u/6793242?v=3","gravatar_id":"","url":"https://api.github.com/users/neworderofjamie","html_url":"https://github.com/neworderofjamie","followers_url":"https://api.github.com/users/neworderofjamie/followers","following_url":"https://api.github.com/users/neworderofjamie/following{/other_user}","gists_url":"https://api.github.com/users/neworderofjamie/gists{/gist_id}","starred_url":"https://api.github.com/users/neworderofjamie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neworderofjamie/subscriptions","organizations_url":"https://api.github.com/users/neworderofjamie/orgs","repos_url":"https://api.github.com/users/neworderofjamie/repos","events_url":"https://api.github.com/users/neworderofjamie/events{/privacy}","received_events_url":"https://api.github.com/users/neworderofjamie/received_events","type":"User","site_admin":false},"body":"Ok, personally I would view that as counter-intuitive :)","created_at":"2015-06-12T12:44:28Z","updated_at":"2015-06-12T12:44:28Z","html_url":"https://github.com/project-rig/nengo_spinnaker/pull/13#discussion_r32312198","pull_request_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/project-rig/nengo_spinnaker/pulls/comments/32312198"},"html":{"href":"https://github.com/project-rig/nengo_spinnaker/pull/13#discussion_r32312198"},"pull_request":{"href":"https://api.github.com/repos/project-rig/nengo_spinnaker/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/project-rig/nengo_spinnaker/pulls/13","id":37271700,"html_url":"https://github.com/project-rig/nengo_spinnaker/pull/13","diff_url":"https://github.com/project-rig/nengo_spinnaker/pull/13.diff","patch_url":"https://github.com/project-rig/nengo_spinnaker/pull/13.patch","issue_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/issues/13","number":13,"state":"open","locked":false,"title":"PES","user":{"login":"neworderofjamie","id":6793242,"avatar_url":"https://avatars.githubusercontent.com/u/6793242?v=3","gravatar_id":"","url":"https://api.github.com/users/neworderofjamie","html_url":"https://github.com/neworderofjamie","followers_url":"https://api.github.com/users/neworderofjamie/followers","following_url":"https://api.github.com/users/neworderofjamie/following{/other_user}","gists_url":"https://api.github.com/users/neworderofjamie/gists{/gist_id}","starred_url":"https://api.github.com/users/neworderofjamie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neworderofjamie/subscriptions","organizations_url":"https://api.github.com/users/neworderofjamie/orgs","repos_url":"https://api.github.com/users/neworderofjamie/repos","events_url":"https://api.github.com/users/neworderofjamie/events{/privacy}","received_events_url":"https://api.github.com/users/neworderofjamie/received_events","type":"User","site_admin":false},"body":"This is more or less ready to go. The only problem I can see (demonstrated by test_pes.py) is that multiple outgoing learnt connections aren't working correctly. I THINK it's something to do with the decoder index, but I can't quite figure it out - Any thoughts?","created_at":"2015-06-09T16:19:49Z","updated_at":"2015-06-12T12:44:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3980f76f7c2d0f67c8eea46728c0bda6e38ec7e6","assignee":{"login":"mundya","id":3439837,"avatar_url":"https://avatars.githubusercontent.com/u/3439837?v=3","gravatar_id":"","url":"https://api.github.com/users/mundya","html_url":"https://github.com/mundya","followers_url":"https://api.github.com/users/mundya/followers","following_url":"https://api.github.com/users/mundya/following{/other_user}","gists_url":"https://api.github.com/users/mundya/gists{/gist_id}","starred_url":"https://api.github.com/users/mundya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mundya/subscriptions","organizations_url":"https://api.github.com/users/mundya/orgs","repos_url":"https://api.github.com/users/mundya/repos","events_url":"https://api.github.com/users/mundya/events{/privacy}","received_events_url":"https://api.github.com/users/mundya/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/pulls/13/commits","review_comments_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/pulls/13/comments","review_comment_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/issues/13/comments","statuses_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/statuses/4d97368a7bdfa84e3504590fad9583d29a2a5f3d","head":{"label":"project-rig:pes","ref":"pes","sha":"4d97368a7bdfa84e3504590fad9583d29a2a5f3d","user":{"login":"project-rig","id":11227885,"avatar_url":"https://avatars.githubusercontent.com/u/11227885?v=3","gravatar_id":"","url":"https://api.github.com/users/project-rig","html_url":"https://github.com/project-rig","followers_url":"https://api.github.com/users/project-rig/followers","following_url":"https://api.github.com/users/project-rig/following{/other_user}","gists_url":"https://api.github.com/users/project-rig/gists{/gist_id}","starred_url":"https://api.github.com/users/project-rig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-rig/subscriptions","organizations_url":"https://api.github.com/users/project-rig/orgs","repos_url":"https://api.github.com/users/project-rig/repos","events_url":"https://api.github.com/users/project-rig/events{/privacy}","received_events_url":"https://api.github.com/users/project-rig/received_events","type":"Organization","site_admin":false},"repo":{"id":33400802,"name":"nengo_spinnaker","full_name":"project-rig/nengo_spinnaker","owner":{"login":"project-rig","id":11227885,"avatar_url":"https://avatars.githubusercontent.com/u/11227885?v=3","gravatar_id":"","url":"https://api.github.com/users/project-rig","html_url":"https://github.com/project-rig","followers_url":"https://api.github.com/users/project-rig/followers","following_url":"https://api.github.com/users/project-rig/following{/other_user}","gists_url":"https://api.github.com/users/project-rig/gists{/gist_id}","starred_url":"https://api.github.com/users/project-rig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-rig/subscriptions","organizations_url":"https://api.github.com/users/project-rig/orgs","repos_url":"https://api.github.com/users/project-rig/repos","events_url":"https://api.github.com/users/project-rig/events{/privacy}","received_events_url":"https://api.github.com/users/project-rig/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/project-rig/nengo_spinnaker","description":"SpiNNaker based Nengo simulator.","fork":true,"url":"https://api.github.com/repos/project-rig/nengo_spinnaker","forks_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/forks","keys_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/teams","hooks_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/hooks","issue_events_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/issues/events{/number}","events_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/events","assignees_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/assignees{/user}","branches_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/branches{/branch}","tags_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/tags","blobs_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/git/refs{/sha}","trees_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/statuses/{sha}","languages_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/languages","stargazers_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/stargazers","contributors_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/contributors","subscribers_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/subscribers","subscription_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/subscription","commits_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/commits{/sha}","git_commits_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/git/commits{/sha}","comments_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/comments{/number}","issue_comment_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/issues/comments{/number}","contents_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/contents/{+path}","compare_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/merges","archive_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/downloads","issues_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/issues{/number}","pulls_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/pulls{/number}","milestones_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/milestones{/number}","notifications_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/labels{/name}","releases_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/releases{/id}","created_at":"2015-04-04T09:41:15Z","updated_at":"2015-06-10T15:24:54Z","pushed_at":"2015-06-12T10:10:50Z","git_url":"git://github.com/project-rig/nengo_spinnaker.git","ssh_url":"git@github.com:project-rig/nengo_spinnaker.git","clone_url":"https://github.com/project-rig/nengo_spinnaker.git","svn_url":"https://github.com/project-rig/nengo_spinnaker","homepage":"","size":981,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":2,"default_branch":"master"}},"base":{"label":"project-rig:master","ref":"master","sha":"ad6e637a660fd9f0ad39e51abe66f5bcdcb11216","user":{"login":"project-rig","id":11227885,"avatar_url":"https://avatars.githubusercontent.com/u/11227885?v=3","gravatar_id":"","url":"https://api.github.com/users/project-rig","html_url":"https://github.com/project-rig","followers_url":"https://api.github.com/users/project-rig/followers","following_url":"https://api.github.com/users/project-rig/following{/other_user}","gists_url":"https://api.github.com/users/project-rig/gists{/gist_id}","starred_url":"https://api.github.com/users/project-rig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-rig/subscriptions","organizations_url":"https://api.github.com/users/project-rig/orgs","repos_url":"https://api.github.com/users/project-rig/repos","events_url":"https://api.github.com/users/project-rig/events{/privacy}","received_events_url":"https://api.github.com/users/project-rig/received_events","type":"Organization","site_admin":false},"repo":{"id":33400802,"name":"nengo_spinnaker","full_name":"project-rig/nengo_spinnaker","owner":{"login":"project-rig","id":11227885,"avatar_url":"https://avatars.githubusercontent.com/u/11227885?v=3","gravatar_id":"","url":"https://api.github.com/users/project-rig","html_url":"https://github.com/project-rig","followers_url":"https://api.github.com/users/project-rig/followers","following_url":"https://api.github.com/users/project-rig/following{/other_user}","gists_url":"https://api.github.com/users/project-rig/gists{/gist_id}","starred_url":"https://api.github.com/users/project-rig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-rig/subscriptions","organizations_url":"https://api.github.com/users/project-rig/orgs","repos_url":"https://api.github.com/users/project-rig/repos","events_url":"https://api.github.com/users/project-rig/events{/privacy}","received_events_url":"https://api.github.com/users/project-rig/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/project-rig/nengo_spinnaker","description":"SpiNNaker based Nengo simulator.","fork":true,"url":"https://api.github.com/repos/project-rig/nengo_spinnaker","forks_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/forks","keys_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/teams","hooks_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/hooks","issue_events_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/issues/events{/number}","events_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/events","assignees_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/assignees{/user}","branches_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/branches{/branch}","tags_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/tags","blobs_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/git/refs{/sha}","trees_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/statuses/{sha}","languages_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/languages","stargazers_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/stargazers","contributors_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/contributors","subscribers_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/subscribers","subscription_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/subscription","commits_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/commits{/sha}","git_commits_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/git/commits{/sha}","comments_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/comments{/number}","issue_comment_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/issues/comments{/number}","contents_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/contents/{+path}","compare_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/merges","archive_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/downloads","issues_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/issues{/number}","pulls_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/pulls{/number}","milestones_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/milestones{/number}","notifications_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/labels{/name}","releases_url":"https://api.github.com/repos/project-rig/nengo_spinnaker/releases{/id}","created_at":"2015-04-04T09:41:15Z","updated_at":"2015-06-10T15:24:54Z","pushed_at":"2015-06-12T10:10:50Z","git_url":"git://github.com/project-rig/nengo_spinnaker.git","ssh_url":"git@github.com:project-rig/nengo_spinnaker.git","clone_url":"https://github.com/project-rig/nengo_spinnaker.git","svn_url":"https://github.com/project-rig/nengo_spinnaker","homepage":"","size":981,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/project-rig/nengo_spinnaker/pulls/13"},"html":{"href":"https://github.com/project-rig/nengo_spinnaker/pull/13"},"issue":{"href":"https://api.github.com/repos/project-rig/nengo_spinnaker/issues/13"},"comments":{"href":"https://api.github.com/repos/project-rig/nengo_spinnaker/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/project-rig/nengo_spinnaker/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/project-rig/nengo_spinnaker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/project-rig/nengo_spinnaker/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/project-rig/nengo_spinnaker/statuses/4d97368a7bdfa84e3504590fad9583d29a2a5f3d"}}}}