title: Fitting 3D data as Input into Keras Sequential Model Layer
body: <p>I'm a newbie in machine learning and Keras. Actually I have worked with scikit-learn but Keras seemed a little bit more complicated. My problem is that I have some data in 3D and want to fit that into a Dense layer(I have also tried with Conv2D, and Conv1D layers). 
  What I did is as follows:</p>
  
  <pre><code>arr1 = np.random.random((30,2))
  arr2 = np.random.random((30,2))
  arr3 = np.random.random((30,2))
  arr4 = np.random.random((30,2))
  arr5 = np.random.random((30,2))
  arr6 = np.random.random((30,2))
  
  x_matrix = np.dstack(
      (arr1
      ,arr2
      ,arr3
      ,arr4
      ,arr5
      ,arr6)
  ).swapaxes(1,2)
  print(x_matrix.shape)
  
  from sklearn.model_selection import train_test_split
  X_train, X_test, y_train, y_test = train_test_split(x_matrix, y_matrix, test_size=0.33, random_state=42)
  
  from keras.models import Sequential
  model = Sequential()
  
  from keras.layers import Dense, Conv2D, Conv1D, Flatten
  
  model = Sequential()
  
  model.add(Dense(6, activation='sigmoid', input_shape=(6,2)))
  
  model.compile(loss='categorical_crossentropy',
                optimizer='sgd',
                metrics=['accuracy'])
  
  model.fit(np.array(X_train), np.array(y_train), epochs=20, batch_size=1)#
  score = model.evaluate(X_test, y_test)
  
  print(score)
  </code></pre>
  
  <p>And I'm getting the error at fit step. The error is as follows:</p>
  
  <pre><code>ValueError: Error when checking target: expected dense_1 to have 3 dimensions, but got array with shape (20, 2)
  </code></pre>
  
  <p>And for Conv1D layer I tried this:</p>
  
  <pre><code>model.add(Conv1D(6, (2),  activation='sigmoid', input_shape=(6 ,2)))
  </code></pre>
  
  <p>And came up with the eror:</p>
  
  <pre><code>ValueError: Error when checking target: expected conv1d_1 to have 3 dimensions, but got array with shape (20, 2)
  </code></pre>
  
  <p>Conv2D seemed more complicated I probably would not need this as my input layer but with the below call I still had the same error.</p>
  
  <pre><code>model.add(Conv2D(6, (2,2),  activation='sigmoid', input_shape=(20,6 ,2)))
  
  ValueError: Error when checking input: expected conv2d_1_input to have 4 dimensions, but got array with shape (20, 6, 2)
  </code></pre>
  
  <p>What I'm asking is: how can I fit fit such a data into a neural network with Keras?</p>