{"action":"created","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/400","labels_url":"https://api.github.com/repos/fchollet/keras/issues/400/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/400/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/400/events","html_url":"https://github.com/fchollet/keras/pull/400","id":95467981,"number":400,"title":"Modifying Merge to work with conv layers. Has a weird bug","user":{"login":"pjadzinsky","id":12551293,"avatar_url":"https://avatars.githubusercontent.com/u/12551293?v=3","gravatar_id":"","url":"https://api.github.com/users/pjadzinsky","html_url":"https://github.com/pjadzinsky","followers_url":"https://api.github.com/users/pjadzinsky/followers","following_url":"https://api.github.com/users/pjadzinsky/following{/other_user}","gists_url":"https://api.github.com/users/pjadzinsky/gists{/gist_id}","starred_url":"https://api.github.com/users/pjadzinsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjadzinsky/subscriptions","organizations_url":"https://api.github.com/users/pjadzinsky/orgs","repos_url":"https://api.github.com/users/pjadzinsky/repos","events_url":"https://api.github.com/users/pjadzinsky/events{/privacy}","received_events_url":"https://api.github.com/users/pjadzinsky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-16T16:05:51Z","updated_at":"2015-07-20T21:55:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fchollet/keras/pulls/400","html_url":"https://github.com/fchollet/keras/pull/400","diff_url":"https://github.com/fchollet/keras/pull/400.diff","patch_url":"https://github.com/fchollet/keras/pull/400.patch"},"body":"Hi\r\n\r\nLet me explain in a few lines what I'm trying to do. I'm a neuroscientist studying visual processing and I'm interested in creating CNN that mimic the visual system (that's what CNNs where originally created for). One thing that the retina does for example is mixing of independent pathways with different scales. Therefore that's what I'm trying to achieve in these branch. The relevant piece of code is in **examples/mnist_cnn2.py** and **keras/layers/core.py** (Merge) the code Iooks like this:\r\n\r\n**mnist_cnn2.py**\r\n`path1 = Sequential()`\r\n`path1.add(Convolution2D(3, 1, 3, 3, border_mode='same')) `\r\n`path1.add(Activation('relu'))`\r\n\r\n`path2 = Sequential()`\r\n`path2.add(Convolution2D(3, 1, 7, 7, border_mode='same')) `\r\n`path2.add(Activation('relu'))`\r\n\r\n`model = Sequential()`\r\n`model.add(Merge([path1, path2], mode='concat', axis=1))`\r\n\r\nI think this looks very natural. Note that I modified the Merge layer, it now has an axis parameter.\r\nHowever, this example doesn't work as shown above (that's why i created a new dev branch), but if you change the Merge line to be either\r\n`model.add(Merge([path1, path1], mode='concat', axis=1))`\r\nor\r\n`model.add(Merge([path2, path2], mode='concat', axis=1))`\r\n\r\nit works perfectly well. However, when mixing path1 and path2 it crashes and I don't understand the error.\r\n\r\nAny ideas?\r\nThanks"},"comment":{"url":"https://api.github.com/repos/fchollet/keras/issues/comments/123058038","html_url":"https://github.com/fchollet/keras/pull/400#issuecomment-123058038","issue_url":"https://api.github.com/repos/fchollet/keras/issues/400","id":123058038,"user":{"login":"lukedeo","id":3826382,"avatar_url":"https://avatars.githubusercontent.com/u/3826382?v=3","gravatar_id":"","url":"https://api.github.com/users/lukedeo","html_url":"https://github.com/lukedeo","followers_url":"https://api.github.com/users/lukedeo/followers","following_url":"https://api.github.com/users/lukedeo/following{/other_user}","gists_url":"https://api.github.com/users/lukedeo/gists{/gist_id}","starred_url":"https://api.github.com/users/lukedeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukedeo/subscriptions","organizations_url":"https://api.github.com/users/lukedeo/orgs","repos_url":"https://api.github.com/users/lukedeo/repos","events_url":"https://api.github.com/users/lukedeo/events{/privacy}","received_events_url":"https://api.github.com/users/lukedeo/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T21:55:38Z","updated_at":"2015-07-20T21:55:38Z","body":"Do you need to use convolutions past these two paths? If not, I recommend `Flatten`ing the output of the convolutional layers before `Merge`ing. The last axis of two convolutions isn't trivially `concat`enable."}}