sparse matrix - Embedding_lookup_sparse of tensorflow without combiner -
in tensorflow, tf.nn.embedding_lookup_sparse must use combiner, donot want combine result.
for example, weights are:
[[1, 0], [0, 1], [2, 0], [3, 0], [1, 1]]
sparse_ids
sparsetensorvalue(indices=array([[0, 0], [0, 1], [0, 2], [0, 3], [0, 4]]), values=array([0, 1, 2, 3, 4]), dense_shape=array([1, 5]))
sparse_values
sparsetensorvalue(indices=array([[0, 0], [0, 1], [0, 2], [0, 3], [0, 4]]), values=array([ 1. , 2. , 3.20000005, 4. , 5. ], dtype=float32), dense_shape=array([1, 5]))
the result of embedding_lookup_sparse is
[[ 1.60526316 0.47368421]]
but hope result is
[[1, 0], [0, 2], [6.4, 0], [12, 0], [5, 5]]
Comments
Post a Comment