/DeepFM_keras

A simple DeepFM.

Primary LanguagePython

DeepFM in Keras

Introduction

A simple DeepFM. See details at here.

Environments

  • Keras 2.0.8
  • TensorFlow 1.7

Usage

    python DeepFM.py

Reference

DeepFM: A Factorization-Machine based Neural Network for CTR Prediction paper address

Notes

If you meet errors about Embedding Layer, try fix the compute_mask function.

    def compute_mask(self, inputs, mask=None):
        if not self.mask_zero:
            return None
        else:
            # return K.not_equal(inputs, 0)
            mask = K.repeat(K.not_equal(inputs, 0), self.output_dim)
            mask = tf.transpose(mask, [0,2,1])
            return mask