{"action":"created","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/3107","repository_url":"https://api.github.com/repos/fchollet/keras","labels_url":"https://api.github.com/repos/fchollet/keras/issues/3107/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/3107/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/3107/events","html_url":"https://github.com/fchollet/keras/issues/3107","id":162976647,"number":3107,"title":"Dimension mismatch in LSTM","user":{"login":"sizhky","id":3656100,"avatar_url":"https://avatars.githubusercontent.com/u/3656100?v=3","gravatar_id":"","url":"https://api.github.com/users/sizhky","html_url":"https://github.com/sizhky","followers_url":"https://api.github.com/users/sizhky/followers","following_url":"https://api.github.com/users/sizhky/following{/other_user}","gists_url":"https://api.github.com/users/sizhky/gists{/gist_id}","starred_url":"https://api.github.com/users/sizhky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sizhky/subscriptions","organizations_url":"https://api.github.com/users/sizhky/orgs","repos_url":"https://api.github.com/users/sizhky/repos","events_url":"https://api.github.com/users/sizhky/events{/privacy}","received_events_url":"https://api.github.com/users/sizhky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-06-29T16:59:24Z","updated_at":"2016-06-30T19:23:05Z","closed_at":null,"body":"Hi,\r\n\r\nI want to create a basic RNN that can add two bytes. Here are the input and outputs, which are expected of a simple addition\r\n\r\nX = [[0, 0], [0, 1], [1, 1], [0, 1], [1, 0], [1, 0], [1, 1], [1, 0]],\r\n(X1 = 00101111 and X2 = 01110010)\r\nY = [1, 0, 1, 0, 0, 0, 0, 1]\r\n\r\nI created the following sequential model\r\nmodel = Sequential()\r\nmodel.add(GRU(output_dim = 16, input_length = 2, input_dim = 8))\r\nmodel.add(Activation('relu'))\r\nmodel.add(Dense(2, activation='softmax'))\r\nmodel.compile(loss = 'binary_crossentropy', optimizer = 'adam', metrics = ['accuracy'])\r\nmodel.summary()\r\n\r\nThe error I get is something along 'expected lstm_input_1 to have 3 dimensions, but got array with shape (8L, 2L)'\r\n\r\n\r\nSo if I increase the dimensions by changing X to [[[0 0]] [[1 1]] [[1 1]] [[1 0]] [[0 0]] [[1 0]] [[0 1]] [[1 0]]]\r\n\r\nThen the error changes to 'expected lstm_input_1 to have shape (None, 8, 2) but got array with shape (8L, 1L, 2L)'\r\n\r\nPlease help..."},"comment":{"url":"https://api.github.com/repos/fchollet/keras/issues/comments/229762184","html_url":"https://github.com/fchollet/keras/issues/3107#issuecomment-229762184","issue_url":"https://api.github.com/repos/fchollet/keras/issues/3107","id":229762184,"user":{"login":"balsulami","id":13775682,"avatar_url":"https://avatars.githubusercontent.com/u/13775682?v=3","gravatar_id":"","url":"https://api.github.com/users/balsulami","html_url":"https://github.com/balsulami","followers_url":"https://api.github.com/users/balsulami/followers","following_url":"https://api.github.com/users/balsulami/following{/other_user}","gists_url":"https://api.github.com/users/balsulami/gists{/gist_id}","starred_url":"https://api.github.com/users/balsulami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balsulami/subscriptions","organizations_url":"https://api.github.com/users/balsulami/orgs","repos_url":"https://api.github.com/users/balsulami/repos","events_url":"https://api.github.com/users/balsulami/events{/privacy}","received_events_url":"https://api.github.com/users/balsulami/received_events","type":"User","site_admin":false},"created_at":"2016-06-30T19:23:05Z","updated_at":"2016-06-30T19:23:05Z","body":"Would you mind sharing the code for that ? "}}
{"actor":{"display_login":"balsulami"}}