Questions tagged [embedding-lookup]

11 questions
12
votes
1 answer

how do I use a very large (>2M) word embedding in tensorflow?

I am running a model with a very big word embedding (>2M words). When I use tf.embedding_lookup, it expects the matrix, which is big. When I run, I subsequently get out of GPU memory error. If I reduce the size of the embedding, everything works…
thang
  • 3,466
  • 1
  • 19
  • 31
6
votes
0 answers

Tensorflow embedding lookup with unequal sized lists

Hej guys, I'm trying to project multi labeled categorical data into a dense space using embeddings. Here's an toy example. Let's say I have four categories and want to project them into a 2D space. Furthermore I got two instances, the first one…
nadre
  • 507
  • 1
  • 4
  • 17
3
votes
0 answers

TypeError: Failed to convert object of type to Tensor

I am trying to convert the input features of GraphSAGE from a numpy dense matrix to a sparse matrix. The algorithm takes a numpy matrix and converts it to a TF variable as follows: self.features = tf.sparse.SparseTensor(indices= features[0],values…
2
votes
0 answers

calculation gradients of tf.nn.embedding_lookup

import tensorflow as tf types_lookup_table = tf.get_variable("types_lookup_table", shape=[234, 10],initializer=tf.random_normal_initializer(0, 1), dtype=tf.float32, trainable=True) embedding_types =…
WeiWang
  • 21
  • 1
2
votes
1 answer

Tensorflow tf.nn.embedding_lookup

is there a small neural network in tf.nn.embedding_lookup?? When I train some data, a value of the same index is changing. So is it trained also? while I'm training my model I checked the official embedding_lookup code but I can not see any…
이준범
  • 21
  • 2
1
vote
0 answers

Tensorflow: how to look up and average a different amount of embedding vectors per training instance, with multiple training instances per minibatch?

In a recommender system setting: let's say I want to learn to predict future item purchases based on user past purchases using an approach inspired by Youtube's recommender system: Concretely, let's say I have a trainable content-based network that…
Pablo Messina
  • 431
  • 1
  • 3
  • 13
0
votes
0 answers

Does -1 is magic key for tf.feature_column?

The code is below: import tensorflow as tf tf.enable_eager_execution() def categorical_column_with_vocabulary_list(): print('------categorical_column_with_vocabulary_list------') feature = { 'price': [1,2,3, -1, -5, -1, -6, -1] …
Ocxs
  • 149
  • 2
  • 10
0
votes
1 answer

Why is the branched output of Tensorflow model yielding only from 1 branch?

I'm a Tensorflow beginner and I'm trying to reproduce the TF Classification by Retrieval model as explained here using Python since the blog provides the code in C++. The model architecture seems to successfully reproduced as shown in the model…
Nikko
  • 1
  • 1
0
votes
0 answers

Using tf.nn.embedding_lookup with multiple columns

I have a problem on making forecasting model(lstm) model now with tensorflow. I try to use embedding_lookup with multiple categorical columns. This is my data (shape[100, 12, 16]) [[[1, 1, 1, 7, 1, -1, 26, 9], [1, 5, 2, -5, 2, 20, 25, 8], [1,…
Ben
  • 45
  • 1
  • 1
  • 6
0
votes
1 answer

What is the work of "tf.nn.embedding_lookup"

I am trying to implement Embedding layer for text classification using CNN. Embedding layer 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") …
0
votes
1 answer

How to execute RNN in python using real values as input data?

I'm trying to run LSTM in python. Does anyone know how to override the "tf.nn.embedding_lookup (embedding, input_data)" method? I'm using float values ​​in my input variable "input_data" but using this method requires integers. What option do I have…