tf.nn.embedding_lookup函数的用法主要是选取一个张量里面索引对应的元素.tf.nn.embedding_lookup(tensor, id):tensor就是输入张量,id就是张量对应的索引,其他的参数不介绍. 例如: import tensorflow as tf; import numpy as np; c = np.random.random([10,1]) b = tf.nn.embedding_lookup(c, [1, 3]) with tf.Session()…
http://stackoverflow.com/questions/34870614/what-does-tf-nn-embedding-lookup-function-do embedding_lookup function retrieves rows of the params tensor. The behavior is similar to using indexing with arrays in numpy. E.g.: matrix = np.random.random([1…