Comments (1)
The implementation is proper.
Consider that Rendle implementation uses one-hot vectors, so when you compute the sum you are mentioning, just one user will be at 1, and just one item will be at 1.
In this implementation, you are not using one-hot vectors. Instead, you are using indexes. That 0 in your example is the same as the one-hot vector for the first item, which should be [1,0,0, ..., 0]. So, the implementation is correct as it's summing the feature of user 1 with the feature for item 0. This is the same as multiplying the corresponding one-hot vectors with the feature vector w in Rendle implementation.
A more interesting question could be: "How does this implementation work with continuous features and multi-hot vectors?".
Everything in this implementation is used as an index, assuming each variable is encoded as a one-hot vector. However, the original implementation can work with any possible type of feature vector in input.
In particular, I am interested in the multi-hot question. I read the implementation, which assumes the dataset comes as user-item indexes followed by the ground truth. However, if I want to add movie genres as multi-hot features, how can I do that with this implementation? If we assume each movie has just one genre, it is straightforward since it is enough to add a column after the item index column. If, instead, we have multiple genres for each movie, how is it possible to model that with the current implementation?
To reformulate better, an example in the dataset could be encoded as follows, following the syntax of Rendle:
[1 0 0 0 0 0 0][0 0 1 0 0 0 0 0 0 0 0 0 0 0][1 0 1 0 0 0 1 0 0 1][4]
The meaning of the vectors is the following: user | item | item genres/categories | rating
Clearly, the item genres are encoded as multi-hot vectors.
I want to model this data with factorization machines using the implementation provided in this repository.
Thank you very much for your time and effort in realizing such a suitable repository.
from pytorch-fm.
Related Issues (20)
- F.dropout的问题 HOT 1
- FactorizationMachine implementation and paper are different HOT 2
- PaddingIdx HOT 1
- One mistake in class MultiLayerPerceptron(torch.nn.Module) in layers.py HOT 1
- why don't you do the pre-trianing in FNN model?
- ModuleNotFoundError: No module named 'torchfm.model.hofm' HOT 3
- autoint实现和论文有出入
- Real-valued features not supported?
- args = parser.parse_args() SystemExit: 2
- tensor for argument #1 HOT 1
- Why FM uses embedding? HOT 1
- one question about data process HOT 1
- Trying to run fnfm on avazu dataset
- network structure difference with deepFM paper
- rank hyper parameter
- Cannot run example on my mac
- But in layers.cpp
- The new link of Criteo_dataset
- np.int and np.long deprecated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch-fm.