Skip to content
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

[FEATURE] Add embeding ranker in PyTorch #2205

Open
3 tasks
miguelgfierro opened this issue Jan 16, 2025 · 7 comments
Open
3 tasks

[FEATURE] Add embeding ranker in PyTorch #2205

miguelgfierro opened this issue Jan 16, 2025 · 7 comments
Labels
enhancement New feature or request

Comments

@miguelgfierro
Copy link
Collaborator

Description

https://www.tensorflow.org/recommenders/examples/basic_ranking, but using PyTorch instead of TF

Expected behavior with the suggested feature

Willingness to contribute

  • Yes, I can contribute for this issue independently.
  • Yes, I can contribute for this issue with guidance from Recommenders community.
  • No, I cannot contribute at this time.

Other Comments

@miguelgfierro miguelgfierro added the enhancement New feature or request label Jan 16, 2025
@jmarrietar
Copy link

Hi @miguelgfierro 👋 , do you mean implementing class RankingModel as in the recommenders example? Could you elaborate a little bit ? :)

@miguelgfierro
Copy link
Collaborator Author

it would be to have a similar model, but in PyTorch. There needs to be code in recommenders folder and a notebook showing an example. If someone wants to implement this, please let me know first because the example of TF is not constructed in the way we do at Recommenders.

@jmarrietar
Copy link

jmarrietar commented Jan 20, 2025

Hi Miguel, I'm not quite familiar yet with recommenders structure, but would like to give it a try and implement this😃

@miguelgfierro
Copy link
Collaborator Author

Nice @jmarrietar

Feel free to attend the next reco meeting on Monday if you want the core team to give you some ideas.

Here some details on how to implement this:

  1. Try to use a similar structure as in most notebooks: https://github.com/recommenders-team/recommenders/blob/main/examples/00_quick_start/sar_movielens.ipynb load data, split, instantiate model, train model, predict model and evaluation.
  2. For loading movielens you can use movielens.load_pandas_df
  3. In the TF page there are two classes: RankingModel and MovielensModel, this is a great example of how not to code. There should be a model called NNEmbedding or whatever you want that defines the structure in the __init__ and then you have a fit method that would input the data and training parameters model.fit(train_df, batch_size, epochs...)
  4. There is no need to do the serving part.
  5. The evaluation can be done similarly to the SAR notebook.

Let me know if you have any questions.

@srivani21
Copy link

I can work on this enhancement, I am thinking that this is based on User and Item like Matrix Factorization and Softmax example, so do I need to implement this based on MF and Softmax or any other but by considering user_id, movie_id and rating?

@miguelgfierro
Copy link
Collaborator Author

@srivani21 this issue is not for matrix factorization, it's a fully connected network.
If you are interested in MF, there are two opportunities to collaborate: #1713 and #2186

@jmarrietar
Copy link

Thanks @miguelgfierro , I will try to attend the Monday meeting to gather ideas, Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants