{"action":"opened","issue":{"url":"https://api.github.com/repos/gpujs/gpu.js/issues/354","repository_url":"https://api.github.com/repos/gpujs/gpu.js","labels_url":"https://api.github.com/repos/gpujs/gpu.js/issues/354/labels{/name}","comments_url":"https://api.github.com/repos/gpujs/gpu.js/issues/354/comments","events_url":"https://api.github.com/repos/gpujs/gpu.js/issues/354/events","html_url":"https://github.com/gpujs/gpu.js/issues/354","id":346475352,"node_id":"MDU6SXNzdWUzNDY0NzUzNTI=","number":354,"title":"can this be accelerated ?","user":{"login":"gammastorm","id":34996255,"node_id":"MDQ6VXNlcjM0OTk2MjU1","avatar_url":"https://avatars2.githubusercontent.com/u/34996255?v=4","gravatar_id":"","url":"https://api.github.com/users/gammastorm","html_url":"https://github.com/gammastorm","followers_url":"https://api.github.com/users/gammastorm/followers","following_url":"https://api.github.com/users/gammastorm/following{/other_user}","gists_url":"https://api.github.com/users/gammastorm/gists{/gist_id}","starred_url":"https://api.github.com/users/gammastorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gammastorm/subscriptions","organizations_url":"https://api.github.com/users/gammastorm/orgs","repos_url":"https://api.github.com/users/gammastorm/repos","events_url":"https://api.github.com/users/gammastorm/events{/privacy}","received_events_url":"https://api.github.com/users/gammastorm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-01T07:11:59Z","updated_at":"2018-08-01T07:11:59Z","closed_at":null,"author_association":"NONE","body":"`\t\tthis.potentials = [];\r\n\t\tfor(var i = 0;i < this.numNeurons;++i) this.potentials.push(0);\r\n\t\t\r\n\t\tthis.gpu = new GPU();\r\n\t\tthis.activate = this.gpu.createKernel(function(ps,n,ws,state,staten) {\r\n\t\t\tif(this.thread.x == n - 1) return 1.0;\r\n\t\t\tif(this.thread.x >= n - staten - 1) return state[n - 2 - this.thread.x];\r\n\t\t\t\r\n\t\t\tvar v = 0;\r\n\t\t\t\r\n\t\t\tfor(var i = 0;i < n;++i) {\r\n\t\t\t\tv += ps[i] * ws[i][this.thread.x];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn Math.atan(v) / 3.141592653589793 * 2;\r\n\t\t}).setOutput([numNeurons]);\r\n`\r\n`\t\r\n\r\n\t        for(var i = 0;i < this.numNeurons;++i) {\r\n\t\t\tthis.potentials = this.activate(this.potentials,this.numNeurons,ws,state,state.length);\r\n\t\t}\r\n`\r\n"}}
{"actor":{"display_login":"gammastorm"}}