8830dc5b81b4b0f8d8080fb60cc4196b5752891e,python/caffe/classifier.py,Classifier,predict,#Classifier#,46

Before Change


            inputs = inputs[:, crop[0]:crop[2], crop[1]:crop[3], :]

        // Classify
        caffe_in = self.preprocess(self.inputs[0], inputs)
        out = self.forward_all(**{self.inputs[0]: caffe_in})
        predictions = out[self.outputs[0]].squeeze(axis=(2,3))

        // For oversampling, average predictions across crops.
        if oversample:
            predictions = predictions.reshape((len(predictions) / 10, 10, -1))
            predictions = predictions.mean(1)

        return predictions

After Change


            inputs = inputs[:, crop[0]:crop[2], crop[1]:crop[3], :]

        // Classify
        caffe_in = np.asarray([self.preprocess(self.inputs[0], in_)
                    for in_ in inputs])
        out = self.forward_all(**{self.inputs[0]: caffe_in})
        predictions = out[self.outputs[0]].squeeze(axis=(2,3))

        // For oversampling, average predictions across crops.
        if oversample:
            predictions = predictions.reshape((len(predictions) / 10, 10, -1))
            predictions = predictions.mean(1)

        return predictions
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: BVLC/caffe
Commit Name: 8830dc5b81b4b0f8d8080fb60cc4196b5752891e
Time: 2014-05-20
Author: shelhamer@imaginarynumber.net
File Name: python/caffe/classifier.py
Class Name: Classifier
Method Name: predict


Project Name: Shawn1993/cnn-text-classification-pytorch
Commit Name: 380653e086e1eee3342e3c9d54854e10e19a711d
Time: 2019-07-17
Author: rriva002@ucr.edu
File Name: cnn_text_classification.py
Class Name: CNNClassifier
Method Name: predict


Project Name: Shawn1993/cnn-text-classification-pytorch
Commit Name: a136549b5f6801aafe6afbc365bed50f71afa9cd
Time: 2019-07-25
Author: rriva002@ucr.edu
File Name: cnn_text_classification.py
Class Name: CNNClassifier
Method Name: __predict