fc81d77c1e18719b58c2437e8408972ad90ce547,tests/classifiers/test_keras.py,TestKerasClassifier,test_loss_gradient,#TestKerasClassifier#,241
Before Change
grads = classifier.loss_gradient(x_test, y_test)
self.assertTrue(np.array(grads.shape == (NB_TEST, 28, 28, 1)).all())
self.assertNotEqual(np.sum(grads), 0)
def test_functional_model(self):
// Need to update the functional_model code to produce a model with more than one input and output layers...
keras_model = KerasClassifier(self.functional_model, clip_values=(0, 1), input_layer=1, output_layer=1)
After Change
def test_loss_gradient(self):
(_, _), (x_test, y_test) = self.mnist
classifier = get_classifier_kr()
// Test gradient
grads = classifier.loss_gradient(x_test, y_test)
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 3
Instances Project Name: IBM/adversarial-robustness-toolbox
Commit Name: fc81d77c1e18719b58c2437e8408972ad90ce547
Time: 2019-08-17
Author: beat.buesser@ie.ibm.com
File Name: tests/classifiers/test_keras.py
Class Name: TestKerasClassifier
Method Name: test_loss_gradient
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: fc81d77c1e18719b58c2437e8408972ad90ce547
Time: 2019-08-17
Author: beat.buesser@ie.ibm.com
File Name: tests/classifiers/test_keras.py
Class Name: TestKerasClassifier
Method Name: test_fit_image_generator
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: fc81d77c1e18719b58c2437e8408972ad90ce547
Time: 2019-08-17
Author: beat.buesser@ie.ibm.com
File Name: tests/classifiers/test_keras.py
Class Name: TestKerasClassifier
Method Name: test_class_gradient
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: fc81d77c1e18719b58c2437e8408972ad90ce547
Time: 2019-08-17
Author: beat.buesser@ie.ibm.com
File Name: tests/classifiers/test_keras.py
Class Name: TestKerasClassifier
Method Name: test_defences_predict
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: fc81d77c1e18719b58c2437e8408972ad90ce547
Time: 2019-08-17
Author: beat.buesser@ie.ibm.com
File Name: tests/classifiers/test_keras.py
Class Name: TestKerasClassifier
Method Name: test_layers