title: How does a 1D multi-channel convolutional layer (Keras) train?
body: <p>I am working with time series EEG data recorded from 10 individual locations on the body to classify future behavior in terms of increasing heart activity. I would like to better understand how my labeled data corresponds to the training inputs.  </p>
  
  
  
  <p>So far, several RNN configurations as well as countless combinations of vanilla dense networks have not gotten me great results and I'd figure a 1D convnet is worth a try. </p>
  
  <p>The things I'm having trouble understanding are:</p>
  
  <p>1.) Feeding data into the model. </p>
  
  <pre class="lang-python prettyprint-override"><code>orig shape         = (30000 timesteps, 10 channels)  
  array fed to layer = (300 slices, 100 timesteps, 10 channels) 
  </code></pre>
  
  <p>Are the slices separated by 1 time step, giving me 300 slices of timesteps at either end of the original array, or are they separated end to end? If the second is true, how could I create an array of (30000 - 100) slices separated by one ts and is also compatible with the 1D CNN layer?</p>
  
  <p>2) Matching labels with the training and testing data  </p>
  
  <p>My understanding is that when you feed in a sequence of <code>train_x_shape = (30000, 10)</code>, there are 30000 labels with <code>train_y_shape = (30000, 2)</code> (2 classes) associated with the <code>train_x</code> data.  </p>
  
  <p>So, when (300 slices of) 100 timesteps of <code>train_x</code> data with <code>shape = (300, 100, 10)</code> are fed into the model, does the label value correspond to the entire 100 ts (one label per 100 ts, with this label being equal to the last time step's label), or are each 100 rows/vectors in the slice labeled- one for each ts?  </p>
  
  <p>Train input:</p>
  
  <pre class="lang-python prettyprint-override"><code>train_x = train_x.reshape(train_x.shape[0], 1, train_x.shape[1])  
  n_timesteps = 100 
  n_channels  = 10
  layer : model.add(Convolution1D(filters = n_channels * 2, padding = 'same', kernel_size = 3, input_shape = (n_timesteps, n_channels))) 
  final layer : model.add(Dense(2, activation = 'softmax'))  
  </code></pre>
  
  <p>I use <code>categorical_crossentropy</code> for loss.</p>