tensorflow / tensorflow/recommenders

[Question] Loss computation in movielens examples

Open
#643 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
300
PR merge metrics
No merged PRs in 30d

Description

Hi, I'm trying to understand the loss computation for the movielens retrieval example. In case of movielens dataset there are ~900 users and ~1600 movies, and when we train the two tower model considering user(U_A)-item(I_A) pairs, we consider only the current U_A-I_A pair as positive (using tf.eye () for labels) and penalizing every other U_A-I_{!A} combinations in the batch. My question is:

  1. One user has interacted with multiple items by penalizing all other User-Item pairs in batch, we are also penalizing some U_A-I_B pairs that are positive
  2. On increasing the batch size, the contributions from positive pairs reduces significantly

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the MovieLens retrieval example and inspect the two-tower loss setup, including the tf.eye labels and in-batch combinations. Done means documenting how multiple user-item interactions and batch size affect positive and negative contributions, with the explanation grounded in the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.