tensorflow / recommenders

TensorFlow Recommenders is a library for building recommender system models using TensorFlow.
Apache License 2.0
1.84k stars 276 forks source link

Retrain retrieval model #384

Open nblasco opened 3 years ago

nblasco commented 3 years ago

Hi, I am very excited about tensorflow-recommenders. I've been testing the examples, and everything has worked quite well. However I would like to know how can I retrain a retrieval model? How should I load the saved model to train with new data?

patrickorlando commented 3 years ago

Hey @nblasco, You would need to save the query and candidate towers, and the optimiser state if you are using anything other than SGD. You could then load these models and resume training. However, if you need to add new values for any of your embedding lookups then it's going to be more tricky, like if you have an embedding for item_id, and your new training set contains previously unseen items. In this case you might need to create new embedding matrices and update values based on your previously trained model, or you might need to look into hash embeddings.

nblasco commented 3 years ago

Thanks Patrik for answering me! I understand that I must save the query model and the candidate model. And rebuild the model with these towers. However in my case it is necessary to add new items and new users daily. Will you have an example of how I can rebuild the embedder arrays adding only the new users and new items?

hishambawa commented 4 weeks ago

@nblasco A bit late, but could you share the solution that you came up with to address this problem if you recall it by any chance?