title: How to understand Keras 1D Convolution input shape and filter
body: <p>I spent some time to understand <code>input_shape = (batch_size, steps, input_dim)</code> in Keras Conv1D, but I cannot make any progress so far.</p>
  
  <p>To be more specific, I have 2 datasets. </p>
  
  <p><em>Dataset-1</em>: Solar energy production of 24 hours of each day in one year, so the size of my dataset is (364,24), days are in row and consumption is in columns.</p>
  
  <p>Example of 2 days:</p>
  
  <pre><code>day-1: [0   0   0   0   0   0   0   1.611   5.791   8.229   9.907   9.649   8.401   6.266   4.728   2.231   0.306   0.013   0   0   0   0   0   0] 
  day-2: [0   0   0   0   0   0   0   1.732   5.839   9.909   12.593  14.242  12.744  9.596   5.808   2.019   0.241   0   0   0   0   0   0   0]`
  </code></pre>
  
  <p>What I want to do with CNN is using 6 days' data to predict the 7th day.
  for that reason, I divided my dataset like so:</p>
  
  <pre><code>xtrain = dataset[0:6,0:24] # takes 24 hour of 6 days
  ytrain = dataset[6,0:24] # takes 24 hour of 7th day
  xtest = dataset[1:7,0:24] # takes 24 hours for 6 days (day2 to day7) to predict day 8
  </code></pre>
  
  <p>To be compatible with Keras' input shape, I reshaped the training data as follows:</p>
  
  <pre><code>xtrain = xtrain.reshape(6,1,24)
  </code></pre>
  
  <p>Number of Samples: 6, Time Dimension: 1, input_dimension:24</p>
  
  <p>Is this correct thinking?</p>
  
  <pre><code>model.add(Conv1D(**filters?**,kernel_size=4,activation='relu', **input_shape=?**)) 
  </code></pre>
  
  <p>In my second dataset:</p>
  
  <pre><code>Training Data: Xtrain: Day-1 Hour-1 to Hour-24, Day-2 Hour-1 to Hour-24 ... Day-6 Hour-1 to Hour-24
  Ytrain: Day-7 Hour-1 to Hour-24
  </code></pre>
  
  <p>I have created a new dataset which takes 24 hours of a day in the rows and 7 days in the columns, so it is a (8616,7) matrix.</p>
  
  <pre><code>hour-1 day-1, day-2 ... day-7
  hour-2 day-1, day-2 ... day-7
  ...
  hour-24 day-1, day-2 ... day-7
  ...
  hour-1 day-2, day-3 ... day-8
  hour-2 day-2, day-3 ... day-8
  ...
  hour-24 day-2, day-3 ... day-8
  ...
  hour-1 day-359, day-360 ... day-365
  hour-2 day-359, day-360 ... day-365
  ...
  hour-24 day-359, day-360 ... day-365
  </code></pre>
  
  <p>Keras Code:</p>
  
  <pre><code>xtrain = dataset[0:24,0:6] # takes 24 hour for 6 days
  ytrain = dataset[24:48,6] # takes 24 hour of 7th day
  xtest = dataset[24:48,0:6] # takes 24 hours for 6 days (day2 to day7) to predict day 7
  
  xtrain = xtrain[newaxis,:, :]
  ytrain = ytrain.reshape(1,24)
  </code></pre>
  
  <p>I really don't understand what filters and input_shape should be.</p>