{"action":"closed","issue":{"url":"https://api.github.com/repos/torch/torch7/issues/302","labels_url":"https://api.github.com/repos/torch/torch7/issues/302/labels{/name}","comments_url":"https://api.github.com/repos/torch/torch7/issues/302/comments","events_url":"https://api.github.com/repos/torch/torch7/issues/302/events","html_url":"https://github.com/torch/torch7/issues/302","id":96531517,"number":302,"title":"is there any fast method to add regularization factor？","user":{"login":"xyzhou-puck","id":6270073,"avatar_url":"https://avatars.githubusercontent.com/u/6270073?v=3","gravatar_id":"","url":"https://api.github.com/users/xyzhou-puck","html_url":"https://github.com/xyzhou-puck","followers_url":"https://api.github.com/users/xyzhou-puck/followers","following_url":"https://api.github.com/users/xyzhou-puck/following{/other_user}","gists_url":"https://api.github.com/users/xyzhou-puck/gists{/gist_id}","starred_url":"https://api.github.com/users/xyzhou-puck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xyzhou-puck/subscriptions","organizations_url":"https://api.github.com/users/xyzhou-puck/orgs","repos_url":"https://api.github.com/users/xyzhou-puck/repos","events_url":"https://api.github.com/users/xyzhou-puck/events{/privacy}","received_events_url":"https://api.github.com/users/xyzhou-puck/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-22T10:32:10Z","updated_at":"2015-07-23T02:31:41Z","closed_at":"2015-07-23T02:31:41Z","body":"Hi guys,\r\n\r\nJust wondering if there is any fast method to add regularization factor before update the parameters, I tried to use getParameters() function to get a pointer of the current parameters and gradients and then I use add(_sim_parameters:clone():mul(l2_norm)) to change the gradients for regularization, and finally do updates, however the method above is pretty slow when I runs on GPU, could you please give me some advices?\r\n\r\nThanks,\r\nXiangyang"}}