title: How to use my own sentence embeddings in Keras?
body: <p>I am new to Keras and I created my own tf_idf sentence embeddings with shape (no_sentences, embedding_dim). I am trying to add this matrix as input to an LSTM layer. My network looks something like this:</p>
  
  <pre><code>q1_tfidf = Input(name='q1_tfidf', shape=(max_sent, 300))
  q2_tfidf = Input(name='q2_tfidf', shape=(max_sent, 300))
  
  q1_tfidf = LSTM(100)(q1_tfidf)
  q2_tfidf = LSTM(100)(q2_tfidf)
  distance2 = Lambda(preprocessing.exponent_neg_manhattan_distance, output_shape=preprocessing.get_shape)(
          [q1_tfidf, q2_tfidf])
  </code></pre>
  
  <p>I'm struggling with how the matrix should be shaped. I am getting this error: </p>
  
  <pre><code>ValueError: Error when checking input: expected q1_tfidf to have 3 dimensions, but got array with shape (384348, 300)
  </code></pre>
  
  <p>I already checked this post: <a href="https://stackoverflow.com/questions/45001437/sentence-embedding-in-keras">Sentence Embedding Keras</a> but still can't figure it out. It seems like I'm missing something obvious.</p>
  
  <p>Any idea how to do this?</p>