{"action":"created","issue":{"url":"https://api.github.com/repos/Lasagne/Lasagne/issues/383","labels_url":"https://api.github.com/repos/Lasagne/Lasagne/issues/383/labels{/name}","comments_url":"https://api.github.com/repos/Lasagne/Lasagne/issues/383/comments","events_url":"https://api.github.com/repos/Lasagne/Lasagne/issues/383/events","html_url":"https://github.com/Lasagne/Lasagne/pull/383","id":100951214,"number":383,"title":"Add cropping to merge layers","user":{"login":"Britefury","id":897534,"avatar_url":"https://avatars.githubusercontent.com/u/897534?v=3","gravatar_id":"","url":"https://api.github.com/users/Britefury","html_url":"https://github.com/Britefury","followers_url":"https://api.github.com/users/Britefury/followers","following_url":"https://api.github.com/users/Britefury/following{/other_user}","gists_url":"https://api.github.com/users/Britefury/gists{/gist_id}","starred_url":"https://api.github.com/users/Britefury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Britefury/subscriptions","organizations_url":"https://api.github.com/users/Britefury/orgs","repos_url":"https://api.github.com/users/Britefury/repos","events_url":"https://api.github.com/users/Britefury/events{/privacy}","received_events_url":"https://api.github.com/users/Britefury/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-14T07:18:31Z","updated_at":"2015-08-15T12:26:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Lasagne/Lasagne/pulls/383","html_url":"https://github.com/Lasagne/Lasagne/pull/383","diff_url":"https://github.com/Lasagne/Lasagne/pull/383.diff","patch_url":"https://github.com/Lasagne/Lasagne/pull/383.patch"},"body":"This PR adds automatic cropping to layers in lasagne/layers/merge.py.\r\n\r\nThis allows `ConcatLayer`, `ElemwiseMergeLayer` etc to automatically crop their inputs before use if the shapes don't match as required.\r\nMy use for this is in implementing segmentation algorithms such as [1]. While the same effect can be achieved using `SliceLayer`, manually computing the slice size can be a pain, so adding automatic cropping to the merge layers simplifies matters.\r\n\r\n[1] U-Net: Convolutional Networks for Biomedical Image Segmentation, http://arxiv.org/abs/1505.04597"},"comment":{"url":"https://api.github.com/repos/Lasagne/Lasagne/issues/comments/131366324","html_url":"https://github.com/Lasagne/Lasagne/pull/383#issuecomment-131366324","issue_url":"https://api.github.com/repos/Lasagne/Lasagne/issues/383","id":131366324,"user":{"login":"Britefury","id":897534,"avatar_url":"https://avatars.githubusercontent.com/u/897534?v=3","gravatar_id":"","url":"https://api.github.com/users/Britefury","html_url":"https://github.com/Britefury","followers_url":"https://api.github.com/users/Britefury/followers","following_url":"https://api.github.com/users/Britefury/following{/other_user}","gists_url":"https://api.github.com/users/Britefury/gists{/gist_id}","starred_url":"https://api.github.com/users/Britefury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Britefury/subscriptions","organizations_url":"https://api.github.com/users/Britefury/orgs","repos_url":"https://api.github.com/users/Britefury/repos","events_url":"https://api.github.com/users/Britefury/events{/privacy}","received_events_url":"https://api.github.com/users/Britefury/received_events","type":"User","site_admin":false},"created_at":"2015-08-15T12:26:47Z","updated_at":"2015-08-15T12:26:47Z","body":"@f0k @benanne I beg your pardon, yes, I did intend to address @f0k :)   I have also refactored the auto-cropping functionality; `MergeCropLayer` is gone and has been replaced by two functions. The layers that use it still take an extra `cropping` parameter to their constructors and apply auto-cropping in their `get_output` and `get_output_shape methods."}}