title: keras max pooling layer after embedding layer
body: <p>I have a 7 word embedding, each in dimension 10, so overall I have a matrix of 7 rows and 10 columns.
  After applying this embedding (using embedding layer), I get the output of dimension (None, 7, 1, 10).</p>
  <p>I want to have a vector, such that its i'th element is the maximum of row i, for each i in the range of {0,6}. Hence, it should be a vector of length 7 (and dimension like (None,7)).</p>
  <p>For this purpose, I first use a reshape layer, to change dimension to (7,10) (otherwise, it does not work).</p>
  <p>Then, I've tried to use GlobalMaxPooling1D for this purpose (also tried MaxPooling1D), and the output does not
  have the dimension that I wanted. It is  (None, 10) instead of (None,7).</p>
  <p>I've checked the GlobalMaxPooling1D on a separate example, and it works well. It must be something with the additional dimension that the embedding layer pushes in the middle.</p>
  <p>p.s. A similar question has been asked here:
  <a href="https://stackoverflow.com/questions/41958115/max-over-time-pooling-in-keras">Max over time pooling in Keras</a>
  But I don't think that the suggested answer there answer the original question (it seems to return the maximum of the entire matrix).</p>
  <p><a href="https://i.stack.imgur.com/AIHUT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AIHUT.png" alt="enter image description here" /></a></p>