c0f75b3a70cc2e433472de9dfd2406c685b561a9,models/item_ranking/bprmf.py,BPRMF,predict,#BPRMF#Any#Any#,142

Before Change


        saver.save(self.sess, path)

    def predict(self, user_id, item_id):
        return self.sess.run([self.pred_y], feed_dict={self.user_id: user_id, self.item_id: item_id})[0]

    def _get_neg_items(self, data):
        all_items = set(np.arange(self.num_item))
        neg_items = {}

After Change


        user_id = tf.expand_dims(tf.convert_to_tensor(user_id), -1)
        item_id = tf.expand_dims(tf.convert_to_tensor(item_id), -1)
        dummy_neg_id = tf.zeros(item_id.shape, tf.int32)
        pred_y, pred_y_neg = self.model([user_id, item_id, dummy_neg_id])
        return pred_y.numpy()

    def _get_neg_items(self, data):
        all_items = set(np.arange(self.num_item))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: cheungdaven/DeepRec
Commit Name: c0f75b3a70cc2e433472de9dfd2406c685b561a9
Time: 2020-02-10
Author: soonmok.kwon@voyagerx.com
File Name: models/item_ranking/bprmf.py
Class Name: BPRMF
Method Name: predict


Project Name: scikit-optimize/scikit-optimize
Commit Name: 9cdd21160f4b4352b05f7b7ce9f0f63506c585c9
Time: 2017-04-17
Author: iaroslav-ai@users.noreply.github.com
File Name: benchmarks/bench_ml.py
Class Name: MLBench
Method Name: evaluate


Project Name: mlflow/mlflow
Commit Name: 20675f9f01e8c365999fee3ff1e4ec55ec5f8b57
Time: 2020-12-15
Author: 39497902+dbczumar@users.noreply.github.com
File Name: tests/onnx/test_onnx_model_export.py
Class Name:
Method Name: predicted


Project Name: pyannote/pyannote-audio
Commit Name: e638a4760c0519cac825d9661a3b5f0a928a507c
Time: 2018-01-20
Author: bredin@limsi.fr
File Name: pyannote/audio/embedding/extraction.py
Class Name: SequenceEmbedding
Method Name: postprocess_ndarray