recommenders
recommenders copied to clipboard
remove num_candidates
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_candidatesasscores.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.
This actually supports an important feature - it's not publicly documented yet, but will be soon.
Ok thanks @maciejkula would you like me to close it then?
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.
Yes, please!
@evanfwelch with this proposed change we wouldn't be able to do Mixed Negative Sampling.