lyst / lightfm

A Python implementation of LightFM, a hybrid recommendation algorithm.
Apache License 2.0
4.67k stars 679 forks source link

Do momentum and gradients required for predictions? #656

Open dbalabka opened 1 year ago

dbalabka commented 1 year ago

Method _check_initialized() called on each prediction methods call. It checks that embeddings, biases, gradients and momentum are set while only embeddings and biases are used for predictions. Do we really require gradients and momentum for predictions? https://github.com/lyst/lightfm/blob/master/lightfm/lightfm.py#L262-L273 https://github.com/lyst/lightfm/blob/master/lightfm/lightfm.py#L259

IMO we can clean up momentums and gradients to minimize memory usage to use the model only for inference.