show-attend-and-tell
show-attend-and-tell copied to clipboard
Does word embedding use pre-trained word embedding or not?
i want to know that use pre-trained word embedding or not.
i found this,
def _word_embedding(self, inputs, reuse=False):
with tf.variable_scope('word_embedding', reuse=reuse):
w = tf.get_variable('w', [self.V, self.M], initializer=self.emb_initializer)
x = tf.nn.embedding_lookup(w, inputs, name='word_vector') # (N, T, M) or (N, M)
return x
tf.nn.embedding_lookup uses pre-trained word embedding?? if use, how to be loaded pre-trained word embedding? if not, train word embedding?