NVIDIA-Merlin / NVIDIA-Merlin/Transformers4Rec
[QST] Extracting User Representation Vectors from Pre-trained Next Item Prediction Model
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.3k
- Forks
- 165
- Avg merge
- 1m
- Merged PRs (30d)
- 2
Description
❓ Questions & Help
Details
I'm currently using the Transformers4Rec for a Next Item Prediction task. I've successfully pre-trained my model, and now I wish to extract user representation vectors from this model on a user-level basis for further analysis.
Despite my efforts, I've been unable to figure out how to correctly extract the hidden vectors that represent users from the pre-trained model. Could you kindly provide some guidance or instructions on how to accomplish this?
More specifically, I've found that when I inspect the tensor in the body of the 'head' before it enters the 'NextItemPredictionTask' module in the model, it outputs the vector for all elements in the 100-length sequence after padding. My goal, however, is to extract the vector located at the variable-length final position within this sequence.
Any assistance on this matter would be greatly appreciated. Thank you.
### Tasks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository files or tests are named. Start by examining the tensor entering the head and the NextItemPredictionTask, focusing on how the variable-length final position is represented; done means documenting or demonstrating extraction of that user-level vector from the pretrained model.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100