massquantity / LibRecommender

Versatile End-to-End Recommender System
https://librecommender.readthedocs.io/
MIT License
380 stars 65 forks source link

Source code Analysis #501

Open 1996srikesh opened 2 months ago

1996srikesh commented 2 months ago

Hi,

I am trying to understand the TwoTower implementation by walking through the source code, but I don't see where the build_model() function is being called. Also, I don't see self.serving_topk() being used anywhere either, only recommend_from_embedding and predict_from_embedding. Can this please be explained?

massquantity commented 2 months ago

Hi, The TwoTower class inherits from the DynEmbedBase class, which inherits from the EmbedBase class. The build_model method is called in the fit method of EmbedBase. self.serving_topk() is used in online serving. Specifically, it is used in the libserving module.