title: How to create neural network with 35 inputs and 1 output?
body: <p>I'm new to machine learning. I'm using Keras to build the following neural network for binary classification: <a href="https://i.stack.imgur.com/UKver.png" rel="nofollow noreferrer">image</a></p>
  
  <p>So I need 35x10 input and 1 binary output. And also I want to train a model on 1 data point at a time. This is the code I'm trying to run:</p>
  
  <pre><code>from keras.models import Sequential
  from keras.layers.core import Dense, Dropout, Activation
  from keras.layers.normalization import BatchNormalization
  
  model_online_1 = Sequential()
  model_online_1.add(BatchNormalization(input_shape=tuple([grouped_X_train.shape[1]])))
  model_online_1.add(Dense(35, batch_size=35, input_dim=10))
  model_online_1.add(Activation('relu'))
  model_online_1.add(Dropout(0.2))
  model_online_1.add(Dense(35))
  model_online_1.add(Activation('relu'))
  model_online_1.add(Dropout(0.2))
  model_online_1.add(Dense(1))
  model_online_1.add(Activation('softmax'))
  model_online_1.compile(loss='categorical_crossentropy', optimizer='adam')
  
  batch_size = 1
  nb_classes = 2
  nb_epoch = 1
  
  for i in range(no_of_samples):
      # train on ith data point
      model_online_1.fit(grouped_X_train[i].T, [grouped_Y1_train[i]],
                         batch_size, nb_epoch,
                          verbose=0)
  </code></pre>
  
  <p>And while fitting I get an error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/natalia/PycharmProjects/raw_recognition/classification.py", line 139, in &lt;module&gt;
      verbose=0)
    File "/home/natalia/.local/lib/python3.6/site-packages/keras/engine/training.py", line 1154, in fit
      batch_size=batch_size)
    File "/home/natalia/.local/lib/python3.6/site-packages/keras/engine/training.py", line 637, in _standardize_user_data
      training_utils.check_array_length_consistency(x, y, sample_weights)
    File "/home/natalia/.local/lib/python3.6/site-packages/keras/engine/training_utils.py", line 244, in check_array_length_consistency
      'and ' + str(list(set_y)[0]) + ' target samples.')
  ValueError: Input arrays should have the same number of samples as target arrays. Found 10 input samples and 1 target samples.
  
  Process finished with exit code 1
  </code></pre>
  
  <p>What is wrong with the model? The last dense layer should return 1 output or  I misunderstand this?</p>
  
  <p>Update: Grouped_X_train.shape: (26, 35, 10) Grouped_Y1_train.shape: (26,)</p>