{"action":"closed","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/5114","repository_url":"https://api.github.com/repos/fchollet/keras","labels_url":"https://api.github.com/repos/fchollet/keras/issues/5114/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/5114/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/5114/events","html_url":"https://github.com/fchollet/keras/issues/5114","id":202292795,"number":5114,"title":"special case of parallel network and parallel input","user":{"login":"sun-peach","id":14579257,"avatar_url":"https://avatars2.githubusercontent.com/u/14579257?v=3","gravatar_id":"","url":"https://api.github.com/users/sun-peach","html_url":"https://github.com/sun-peach","followers_url":"https://api.github.com/users/sun-peach/followers","following_url":"https://api.github.com/users/sun-peach/following{/other_user}","gists_url":"https://api.github.com/users/sun-peach/gists{/gist_id}","starred_url":"https://api.github.com/users/sun-peach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sun-peach/subscriptions","organizations_url":"https://api.github.com/users/sun-peach/orgs","repos_url":"https://api.github.com/users/sun-peach/repos","events_url":"https://api.github.com/users/sun-peach/events{/privacy}","received_events_url":"https://api.github.com/users/sun-peach/received_events","type":"User","site_admin":false},"labels":[{"id":611595073,"url":"https://api.github.com/repos/fchollet/keras/labels/stale","name":"stale","color":"ffffff","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-01-21T05:01:42Z","updated_at":"2017-07-10T01:01:56Z","closed_at":"2017-07-10T01:01:56Z","body":"Hi, dear all,\r\n\r\nKeras has the merge function for parallel network and I have seen several examples. However, I have a special case that I did not find any example can tell if it is right or wrong. I have several sub network in my whole system. The first part has two parallel networks and their output will be concatenated and sent to the next part. The second part will take in the concatenated input and send them to two parallel network, the resulting output will be concatenated again and sent out. Could anyone tell me if the following code is right?\r\n\r\nE1 = Sequential()\r\nE2 = Sequential()\r\nE1.add(Dropout(dropout))\r\nE2.add(Dropout(dropout))\r\nE1.add(LSTM(hidden_dim, batch_input_shape=(shape[1], shape[2][:I1_dim]))\r\nE2.add(LSTM(hidden_dim, batch_input_shape=(shape[1], shape[2][I1_dim:]))\r\nif bidirectional:\r\n    E1 = Bidirectional(E1, merge_mode='sum')\r\n    E2 = Bidirectional(E2, merge_mode='sum')\r\nencoder = Merge([E1, E2], mode=\"concat\")\r\ninput1 = Input(batch_shape=(shape[0],shape[1],shape[2][:I1_dim]))\r\ninput2 = Input(batch_shape=(shape[0],shape[1],shape[2][I1_dim:]))\r\ninput = Merge([input1,input2],mode=\"concat\")\r\nencoded = encoder(input)\r\n\r\n\r\nHere, I1_dim represent the dimension of the input stream 1. The shape is the shape of the output from the previous sub network whose format is (sample_num,length,feature_dim).\r\n\r\nI am not quite sure if this is right? Can someone tell me? If it is not right, how can I correct it?\r\n\r\nThank you very much!"}}
{"actor":{"display_login":"probot-stale"}}