{"action":"created","issue":{"url":"https://api.github.com/repos/Theano/Theano/issues/2872","labels_url":"https://api.github.com/repos/Theano/Theano/issues/2872/labels{/name}","comments_url":"https://api.github.com/repos/Theano/Theano/issues/2872/comments","events_url":"https://api.github.com/repos/Theano/Theano/issues/2872/events","html_url":"https://github.com/Theano/Theano/pull/2872","id":73041467,"number":2872,"title":"Add new scalar and elemwise op erfcx","user":{"login":"TimSalimans","id":4402977,"avatar_url":"https://avatars.githubusercontent.com/u/4402977?v=3","gravatar_id":"","url":"https://api.github.com/users/TimSalimans","html_url":"https://github.com/TimSalimans","followers_url":"https://api.github.com/users/TimSalimans/followers","following_url":"https://api.github.com/users/TimSalimans/following{/other_user}","gists_url":"https://api.github.com/users/TimSalimans/gists{/gist_id}","starred_url":"https://api.github.com/users/TimSalimans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimSalimans/subscriptions","organizations_url":"https://api.github.com/users/TimSalimans/orgs","repos_url":"https://api.github.com/users/TimSalimans/repos","events_url":"https://api.github.com/users/TimSalimans/events{/privacy}","received_events_url":"https://api.github.com/users/TimSalimans/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-04T14:50:54Z","updated_at":"2015-05-08T10:08:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Theano/Theano/pulls/2872","html_url":"https://github.com/Theano/Theano/pull/2872","diff_url":"https://github.com/Theano/Theano/pull/2872.diff","patch_url":"https://github.com/Theano/Theano/pull/2872.patch"},"body":"op for calculating the scaled complementary error function exp(x***2)**erfc(x) in a numerically stable way\r\n\r\nThis op is useful for calculating various things related to Gaussian distributions, such as truncated moments and expressions involving log(cdf(x)) for large negative values of x. The contributed code very closely follows that of the Erfinv op.\r\n\r\nTested on an EC2 GPU instance. Works for both CPU and GPU."},"comment":{"url":"https://api.github.com/repos/Theano/Theano/issues/comments/100182507","html_url":"https://github.com/Theano/Theano/pull/2872#issuecomment-100182507","issue_url":"https://api.github.com/repos/Theano/Theano/issues/2872","id":100182507,"user":{"login":"TimSalimans","id":4402977,"avatar_url":"https://avatars.githubusercontent.com/u/4402977?v=3","gravatar_id":"","url":"https://api.github.com/users/TimSalimans","html_url":"https://github.com/TimSalimans","followers_url":"https://api.github.com/users/TimSalimans/followers","following_url":"https://api.github.com/users/TimSalimans/following{/other_user}","gists_url":"https://api.github.com/users/TimSalimans/gists{/gist_id}","starred_url":"https://api.github.com/users/TimSalimans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimSalimans/subscriptions","organizations_url":"https://api.github.com/users/TimSalimans/orgs","repos_url":"https://api.github.com/users/TimSalimans/repos","events_url":"https://api.github.com/users/TimSalimans/events{/privacy}","received_events_url":"https://api.github.com/users/TimSalimans/received_events","type":"User","site_admin":false},"created_at":"2015-05-08T10:08:35Z","updated_at":"2015-05-08T10:08:35Z","body":"Having an automatic optimization would be nice, but difficult to do given the current framework: Whether you want to calculate exp(x***2)**erfc(x) or erfcx(x) depends on the value of x. I currently deal with this by using T.switch() a lot in my own code, but this is probably not a good solution to introduce as a general optimization."}}