c8a9b2b2f14226567f2e1b42e7cf007b38c0fba3,tests/classifiers/test_pytorch.py,TestPyTorchClassifier,test_fit_predict,#TestPyTorchClassifier#,99

Before Change



    def test_fit_predict(self):
        // Get MNIST
        (_, _), (x_test, y_test) = self.mnist

        // Test predict
        preds = self.module_classifier.predict(x_test)

After Change


        master_seed(1234)

    def test_fit_predict(self):
        classifier = get_classifier_pt()
        predictions = classifier.predict(self.x_test)
        accuracy = np.sum(np.argmax(predictions, axis=1) == np.argmax(self.y_test, axis=1)) / NB_TEST
        logger.info("Accuracy after fitting: %.2f%%", (accuracy * 100))
        self.assertEqual(accuracy, 0.3)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 8

Instances


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c8a9b2b2f14226567f2e1b42e7cf007b38c0fba3
Time: 2019-08-19
Author: beat.buesser@ie.ibm.com
File Name: tests/classifiers/test_pytorch.py
Class Name: TestPyTorchClassifier
Method Name: test_fit_predict


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c8a9b2b2f14226567f2e1b42e7cf007b38c0fba3
Time: 2019-08-19
Author: beat.buesser@ie.ibm.com
File Name: tests/classifiers/test_pytorch.py
Class Name: TestPyTorchClassifier
Method Name: test_loss_gradient


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c8a9b2b2f14226567f2e1b42e7cf007b38c0fba3
Time: 2019-08-19
Author: beat.buesser@ie.ibm.com
File Name: tests/classifiers/test_pytorch.py
Class Name: TestPyTorchClassifier
Method Name: test_fit_generator


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c8a9b2b2f14226567f2e1b42e7cf007b38c0fba3
Time: 2019-08-19
Author: beat.buesser@ie.ibm.com
File Name: tests/classifiers/test_pytorch.py
Class Name: TestPyTorchClassifier
Method Name: test_class_gradient_target


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c8a9b2b2f14226567f2e1b42e7cf007b38c0fba3
Time: 2019-08-19
Author: beat.buesser@ie.ibm.com
File Name: tests/classifiers/test_pytorch.py
Class Name: TestPyTorchClassifier
Method Name: test_class_gradient