Code Monkey home page Code Monkey logo

Comments (6)

rnyak avatar rnyak commented on May 29, 2024

@MelissaKR thanks for the question. Can you tell us more about your use case?

Basically, if you want to do some feature pre-processing on the column of pre-trained embeddings, yes, you can feed them as continuous features to NVTabular.

Let us know if you have further questions.

from dataloader.

MelissaKR avatar MelissaKR commented on May 29, 2024

@rnyak Thank you for your response. I basically have another model that outputs embeddings for a given set of features, and I want to replace those features in the original model with the embeddings I have obtained.
Should I simply pass these new feature columns as conts in TorchAsyncItr? It'll be great if I could see an example code of how pre-trained embeddings are passed to NVTabular's TorchAsyncItr.

from dataloader.

viswa-nvidia avatar viswa-nvidia commented on May 29, 2024

@rnyak , to follow up on this.

from dataloader.

rnyak avatar rnyak commented on May 29, 2024

@MelissaKR this issue was open for a while. do you mind giving a bit more detail about what you want to do with the embeddings you are getting from another model and what's your original model? We are currently supporting feeding embeddings to embedding layer you can see that tensorflow example. let us know if that's something you were looking for, or something else? thanks.

from dataloader.

MelissaKR avatar MelissaKR commented on May 29, 2024

@rnyak Thank you for getting back to me on this! I have a main model and in that model, let's say I have a feature for different movies. I can pass it as a regular categorical feature to then be fed to the embedding layer. My model uses PyTorch, by the way. But I have trained a different model that uses collaborative filtering which learns embeddings for these movies much better. So now, for each movie in the training and validation set for the main model, I have vectors of size n that are the learned embeddings. And I don't need to use this movie feature anymore and pass it to an embedding layer. Instead, I want to remove it from my dataset and use the learned embeddings from the second model, but I want to see if there is a straightforward way of doing this, instead of manually defining n new numeric features for each element in the new movie embeddings and pass them to NVTabular. In other words, how can I pass pre-trained embeddings as is to my model?
I hope I could clarify my question and use case.

from dataloader.

rnyak avatar rnyak commented on May 29, 2024

@MelissaKR thanks for the clarification. we are currently working on that and we will be creating an example shortly. Example might not be on PyT but you can adapt it to your framework I believe :) Can you please tell me what's the architecture of your main model? it is an MLP model? or a more complicated architecture? Besides can you share a simple screenshot what would your data look like ? contains nested 3D arrays? or is it something like below?

movie_id movie_embedding
1 [float1, float2, ..., float64]
2 [float1, float2, ..., float64]
..
n [float1, float2, ..., float64]

or more like this
movie_id. movie_genres_id. movie_genres_embeddings
1 [1, 2, 3] [[float1, float2, ..., float64] , [float1, float2, ..., float64] , ...]
2 [3,5] [float1, float2, ..., float64] , [float1, float2, ..., float64] ]

from dataloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.