【发布时间】:2016-07-07 10:28:18
【问题描述】:
我正在尝试将 word2vec 应用于卷积神经网络。我是 TensorFlow 的新手。这是我的预训练层代码。
W = tf.Variable(tf.constant(0.0, shape=[vocabulary_size, embedding_size]),
trainable=False, name="W")
embedding_placeholder = tf.placeholder(tf.float32, [vocabulary_size, embedding_size])
embedding_init = W.assign(embedding_placeholder)
sess = tf.Session()
sess.run(embedding_init, feed_dict={embedding_placeholder: final_embeddings})
我想我应该使用embedding_lookup,但不知道如何使用它。我真的很感激有人可以提供一些建议。
谢谢
【问题讨论】:
标签: tensorflow conv-neural-network word2vec