kuandeng / LightGCN

479 stars 127 forks source link

could I save the embedding of trained model,then matmul ? #13

Closed ucasiggcas closed 4 years ago

ucasiggcas commented 4 years ago

hi,dear a big data could take a long time in inference, more than an hour, So I wanna save the embedding of the user and item,then matmul with LSH or Faiss ,but the results' metrics are not same as the tf.matmul, that is, its very worse,

        """
        *********************************************************
        Inference for the testing phase.
        """
        self.item_embeddings_final = tf.Variable(tf.zeros([self.n_items, self.emb_dim]),
                                                 dtype=tf.float32, name="item_embeddings_final", trainable=False)
        self.user_embeddings_final = tf.Variable(tf.zeros([self.n_users, self.emb_dim]),
                                                 dtype=tf.float32, name="user_embeddings_final", trainable=False)

So could you pls help me ? thx

ucasiggcas commented 4 years ago

soved the problem,so will close