Using pre-trained word embeddings in tensorflow's seq2seq function
<p>I am building a seq2seq model using functions in tensorflow's <code>seq2seq.py</code>, where they have a function like this:</p>

<pre><code>embedding_rnn_seq2seq(encoder_inputs, decoder_inputs, cell,
                          num_encoder_symbols, num_decoder_symbols,
                          embedding_size, output_projection=None,
                          feed_previous=False, dtype=dtypes.float32,
                          scope=None)
</code></pre>

<p>however, it seems that this function does not take pre-trained embeddings as input, are there any ways that I can take pre-trained word embeddings as input in this function?</p>

<p>There is no parameter you just hand over. Read in your embeddings (make sure vocabulary IDs match). Then, once you initialized all variables, find the embedding tensor (iterate through tf.all_variables to find the name). Then use tf.assign to overwrite the randomly initialized embeddings there with your embeddings.</p>

python machine-learning tensorflow recurrent-neural-network lstm