【发布时间】:2018-05-19 08:00:47
【问题描述】:
我正在尝试使用 CNN 实现用于文本分类的嵌入层。
嵌入层with tf.device('/cpu:0'), tf.name_scope("embedding"):
self.W = tf.Variable(tf.random_uniform([vocab_size, embedding_size], -1.0, 1.0),name="W")
self.embedded_chars = tf.nn.embedding_lookup(self.W, self.inputTensor)
self.embedded_chars_expanded = tf.expand_dims(self.embedded_chars, -1)
我无法理解 tf.nn.embedding_lookup 工作。
【问题讨论】:
标签: tensorflow text-classification word-embedding embedding-lookup