[TASK] Support shared embeddings across the towers
🚀 Feature request
We should be able to jointly encode multiple columns (e.g., purchased_id, item_id) and let them share the same embedding tables during model training, both for ranking and retrieval models.
For Two-tower model (or similar), If we can have those functionalities that'd be very useful:
- [x] support shared embeddings within each tower (encoder)
- [ ] support shared embeddings across the towers
There might be cases that customers want to write a model that they might want to represent the users as a list of the items they consumed. In such case, customers want to have an input feature in the user tower to look up the embeddings from a separate tower - so that different features shares the same int_domain.
Motivation
Customers are interested in this feature and asked about it.
check with @rnyak and split the ticket
We need an example to showcase the functionality.
closing since the functionality should be completed but we do not have an example notebook.
We have a test now that can serve as reference for this functionality here (added in #841)
https://github.com/NVIDIA-Merlin/models/blob/release-22.11/tests/unit/tf/models/test_retrieval.py#L25-L76