Skip to content

An arbitrary order Factorization Machine based on Keras and TensorFlow2.0

Notifications You must be signed in to change notification settings

orangelle/kerasfm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kerasfm

An arbitrary order Factorization Machine based on TensorFlow2.0

It's a tensorflow2.0-style interpretation of tffm. Most of the core parts are rewritten with Keras API, which is highly encouraged in tensorflow2.0

Dependencies

  • scikit-learn
  • numpy
  • tqdm
  • tensorflow2.0+

Usage

Usage is a little different from the original one because of the change in the optimizer of tf2.0.

from tffm import TFFMClassifier
model = TFFMClassifier(
    order=6,
    rank=10,
    optimizer=tf.keras.optimizers.Adam(learning_rate=0.00001),
    n_epochs=100,
    batch_size=-1,
    init_std=0.001,
    input_type='dense'
)
model.fit(X_tr, y_tr, show_progress=True)

About

An arbitrary order Factorization Machine based on Keras and TensorFlow2.0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published