neuMF | This is our implementation for the paper | Recommender System library
kandi X-RAY | neuMF Summary
kandi X-RAY | neuMF Summary
This is our implementation for the paper:. Xiangnan He, Lizi Liao, Hanwang Zhang, Liqiang Nie, Xia Hu and Tat-Seng Chua (2017). Neural Collaborative Filtering. In Proceedings of WWW '17, Perth, Australia, April 03-07, 2017. Three collaborative filtering models: Generalized Matrix Factorization (GMF), Multi-Layer Perceptron (MLP), and Neural Matrix Factorization (NeuMF). To target the models for implicit feedback and ranking task, we optimize them using log loss with negative sampling. Author: Dr. Xiangnan He (
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Evaluate a model
- Evaluate a single rating
- Calculate the CDG of a given rank
- Gets the hit ratio of item in ranklist
- Get an MLP model
- Parse command line arguments
- Load a pretraining model
- Generate train instances
neuMF Key Features
neuMF Examples and Code Snippets
Community Discussions
Trending Discussions on neuMF
QUESTION
The neuMF
class is not a Keras
's class and therefore it doesn't provide any compile method.
I would better use keras.Model
instead of nn.Blocks
.
Unfortunately, I do not really understand what nn.Blocks is and how I could replace it in the class.
How should I modfy my code, so that it works with keras.Model
and can use the Keras
method?
Here is my code:
...ANSWER
Answered 2020-Oct-20 at 21:43After already quite some discussion in the comments, there are still several problems with your code and clarification needed from your side:
- subclasses of
keras.Model
should implement the__call__
method, but not aforward
method. - you can't just build
numpy
-operations likenp.concatenate
inside your model, always usekeras
-layers liketf.keras.layers.Concatenate
. - as already commented, the error you've posted most likely comes from
num_factors
,num_users
,num_items
not being integer, though I can only guess here, since you did not provide those to us. - also, I can currently only guess what you are trying to achieve, since this is not at all clear from what you posted.
Let us approach the issues in a different way. The following code snippet runs without error and might be a good starting point for you:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install neuMF
You can use neuMF like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page