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))

After Change



    def predict(self, user_id, item_id):
        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: 3

Non-data size: 10

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: tensorflow/models
Commit Name: 855d29dba61a53553e8fc89237773368fd7e9cdf
Time: 2020-07-29
Author: sbeery@google.com
File Name: research/object_detection/dataset_tools/context_rcnn/generate_detection_data.py
Class Name: GenerateDetectionDataFn
Method Name: _run_inference_and_generate_detections


Project Name: tensorflow/models
Commit Name: 855d29dba61a53553e8fc89237773368fd7e9cdf
Time: 2020-07-29
Author: sbeery@google.com
File Name: research/object_detection/dataset_tools/context_rcnn/generate_embedding_data.py
Class Name: GenerateEmbeddingDataFn
Method Name: _run_inference_and_generate_embedding