-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dynamic_embedding does not support tf.RaggedTensor as the input to look up #226
Comments
@cockroachzl Thanks for feedback. Unfortunately, embedding_lookup currently only supports Tensor and SparseTensor. If using RaggedTensor, you'll have to process before lookup. BTW, what do you expect on the lookup result, if using ragged tensor as input? |
Got it, right now I work around this by using regular tf.tensor.
I expect the look up result to be the same as using tf.keras.layers.Embedding with ragged tensors as the input. If the input is tf.ragged.constant([
[[0.1,0.1], [0.2,0.2]],
[[0.3,0.3]],
[[0.4,0.4], [0.5,0.5], [0.6,0.6]]
]) |
Maybe we need write an extra kernel code to lookup ragged tensor. If you could contribute it that will be so nice. @cockroachzl |
#397 @cockroachzl ragged tensor supported |
Describe the feature and the current behavior/state.
First of all, thank you all for making this awesome project!
Right now dynamic embedding seems does not support embedding lookup with ragged tensor. For example, this code snippet for dynamic embedding lookup works well with regular tf.tensor
However, if
movie_ids
is a ragged tensor, likedoing the embedding lookup failed with the following stack trace
As a consequence, the high level keras embedding layers built on top of it failed as well, such as
tf.RaggedTensor are usually used to represent features in recommender ranking models such as:
Is there any plan to support embedding lookup with ragged tensors?
Relevant information
Which API type would this fall under (layer, metric, optimizer, etc.)
Who will benefit with this feature?
Any recommender developer who wishes to use ragged tensor to look up dynamic embedding
Any other info.
The text was updated successfully, but these errors were encountered: