{"action":"created","issue":{"url":"https://api.github.com/repos/torch/nn/issues/260","labels_url":"https://api.github.com/repos/torch/nn/issues/260/labels{/name}","comments_url":"https://api.github.com/repos/torch/nn/issues/260/comments","events_url":"https://api.github.com/repos/torch/nn/issues/260/events","html_url":"https://github.com/torch/nn/pull/260","id":73445558,"number":260,"title":"Adding Batch L2 Normalization Layer that L2 normalizes rows of input Tensor","user":{"login":"karpathy","id":241138,"avatar_url":"https://avatars.githubusercontent.com/u/241138?v=3","gravatar_id":"","url":"https://api.github.com/users/karpathy","html_url":"https://github.com/karpathy","followers_url":"https://api.github.com/users/karpathy/followers","following_url":"https://api.github.com/users/karpathy/following{/other_user}","gists_url":"https://api.github.com/users/karpathy/gists{/gist_id}","starred_url":"https://api.github.com/users/karpathy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karpathy/subscriptions","organizations_url":"https://api.github.com/users/karpathy/orgs","repos_url":"https://api.github.com/users/karpathy/repos","events_url":"https://api.github.com/users/karpathy/events{/privacy}","received_events_url":"https://api.github.com/users/karpathy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-05T22:07:34Z","updated_at":"2015-05-06T03:45:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/torch/nn/pulls/260","html_url":"https://github.com/torch/nn/pull/260","diff_url":"https://github.com/torch/nn/pull/260.diff","patch_url":"https://github.com/torch/nn/pull/260.patch"},"body":"This layer L2 normalizes an `n x d` Tensor. I tested the implementation on both CPU/GPU and gradient checked it with `jac` and also with my (other) custom code. I also compared to a slower version that uses a loop, as can be seen in this [gist](https://gist.github.com/karpathy/f3ee599538ff78e1bbe9). (This batched version is quite a lot faster)\r\n\r\nAlso, I have only worked with Torch for ~2 weeks so exercise caution :)"},"comment":{"url":"https://api.github.com/repos/torch/nn/issues/comments/99312692","html_url":"https://github.com/torch/nn/pull/260#issuecomment-99312692","issue_url":"https://api.github.com/repos/torch/nn/issues/260","id":99312692,"user":{"login":"karpathy","id":241138,"avatar_url":"https://avatars.githubusercontent.com/u/241138?v=3","gravatar_id":"","url":"https://api.github.com/users/karpathy","html_url":"https://github.com/karpathy","followers_url":"https://api.github.com/users/karpathy/followers","following_url":"https://api.github.com/users/karpathy/following{/other_user}","gists_url":"https://api.github.com/users/karpathy/gists{/gist_id}","starred_url":"https://api.github.com/users/karpathy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karpathy/subscriptions","organizations_url":"https://api.github.com/users/karpathy/orgs","repos_url":"https://api.github.com/users/karpathy/repos","events_url":"https://api.github.com/users/karpathy/events{/privacy}","received_events_url":"https://api.github.com/users/karpathy/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T03:45:23Z","updated_at":"2015-05-06T03:45:23Z","body":"Thanks for comments! Some of these issues I was aware of and some of them were just silly mistakes (e.g. reshape) - sorry about that. I did a rewrite that should now be much more time-efficient (at cost of space and readability), but it works."}}