-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH Factorization Machine classifier #50
Conversation
Oh nice. I've been looking for a good TF FM implementation :) |
Hi @mdagost! We only have a classifier. A PR for the regressor is welcome! |
muffnn/fm/fm_classifier.py
Outdated
v2 = self._v * self._v | ||
v2x2 = tf.stack([matmul(x2, v2[i, :, :]) | ||
for i in range(self.rank)], axis=1) | ||
int_term = 0.5 * tf.reduce_sum(tf.square(vx) - v2x2, axis=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The axis=1
is a little confusing since its in the middle of this 3-dim array. Maybe change it to axis=-1
instead?
Just making sure: there's no way to write eqn 1) here http://www.algo.uni-konstanz.de/members/rendle/pdf/Rendle2010FM.pdf in matrix format, is there? |
Yeah equation 1 is the slow version. The TF I have is the best I know of. |
LGTM |
This PR adds a factorization machine classifier.
I am going to leave the regressor for another PR.