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

remove num_candidates #301

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

evanfwelch
Copy link

Context

One nice feature of the tfrs.tasks.retrieval task is how simple it is. Especially how it dot products equal-sized of query and candidate embeddings and internally computes the "labels" as the identity matrix.

This PR

  • removes the computation and use of num_candidates as scores.shape[1]. The task doesn't support any kind of non-square score matrix as far as I can tell and having this extra degree of freedom actually made it harder for me to understand what was happening.

I would humbly suggest removing these bits for now and adding back in if there becomes a more general way to pass in candidates of a different shape.

@google-cla google-cla bot added the cla: yes label May 21, 2021
@maciejkula
Copy link
Collaborator

This actually supports an important feature - it's not publicly documented yet, but will be soon.

@evanfwelch
Copy link
Author

Ok thanks @maciejkula would you like me to close it then?

@evanfwelch
Copy link
Author

Hi @maciejkula, friendly nudge here... seems like this change makes things a bit clearer (since it seems like num_candidates == num_queires) but understood that you're suggesting that will eventually not be the case and you want to keep this.

@maciejkula
Copy link
Collaborator

Yes, please!

@TimSchmeier
Copy link
Contributor

@evanfwelch with this proposed change we wouldn't be able to do Mixed Negative Sampling.

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

Successfully merging this pull request may close these issues.

None yet

3 participants