title: How does it works the input_shape variable in Conv1d in Keras?
body: <p>Ciao,
  I'm working with CNN 1d on Keras but I have tons of troubles with the input shape variable.</p>
  
  <p>I have a time series of 100 timesteps and 5 features with boolean labels. I want to train a CNN 1d that works with a sliding window of length 10. This is a very simple code I wrote:</p>
  
  <pre class="lang-py prettyprint-override"><code>from keras.models import Sequential
  from keras.layers import Dense, Conv1D
  import numpy as np
  
  N_FEATURES=5
  N_TIMESTEPS=10
  X = np.random.rand((100, N_FEATURES))
  Y = np.random.randint(0,2, size=100)
  
  
  # CNN
  model.Sequential()
  model.add(Conv1D(filter=32, kernel_size=N_TIMESTEPS, activation='relu', input_shape=N_FEATURES
  model.add(Dense(1, activation='sigmoid'))
  model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
  </code></pre>
  
  <p>My problem here is that I get the following error:</p>
  
  <pre class="lang-py prettyprint-override"><code>  File "&lt;ipython-input-2-43966a5809bd&gt;", line 2, in &lt;module&gt;
      model.add(Conv1D(filter=32, kernel_size=10, activation='relu', input_shape=N_FEATURES))
  TypeError: __init__() takes at least 3 arguments (3 given)
  </code></pre>
  
  <p>I've also tried by passing to the input_shape the following values:</p>
  
  <pre class="lang-py prettyprint-override"><code>input_shape=(None, N_FEATURES)
  input_shape=(1, N_FEATURES)
  input_shape=(N_FEATURES, None)
  input_shape=(N_FEATURES, 1)
  input_shape=(N_FEATURES, )
  </code></pre>
  
  <blockquote>
    <p>Do you know what's wrong with the code or in general can you explain the logic behind in <strong>input_shape</strong> variable in Keras CNN?</p>
  </blockquote>
  
  <p>The crazy thing is that my problem is the same of the following:</p>
  
  <p><a href="https://stackoverflow.com/questions/53465066/keras-cnn-error-expected-sequence-to-have-3-dimensions-but-got-array-with-shap">Keras CNN Error: expected Sequence to have 3 dimensions, but got array with shape (500, 400)</a></p>
  
  <p>But I cannot solve it with the solution given in the post.</p>
  
  <blockquote>
    <p>The Keras version is <strong>2.0.6-tf</strong></p>
  </blockquote>
  
  <p>Thanks</p>