90f779c858aadaeb2b0621ba23e57967ef27d4d2,tests/estimators/classification/test_common_deeplearning.py,,test_fit_image_generator,#Any#Any#Any#Any#Any#,49
Before Change
classifier, sess = get_image_classifier_list(one_classifier=True, from_logits=True)
if classifier is not None:
data_gen = image_data_generator(sess=sess)
(_, _), (x_test_mnist, y_test_mnist) = get_default_mnist_subset
true_class = np.argmax(y_test_mnist, axis=1)
predictions = classifier.predict(x_test_mnist)
prediction_class = np.argmax(predictions, axis=1)
pre_fit_accuracy = np.sum(prediction_class == true_class) / x_test_mnist.shape[0]
np.testing.assert_array_almost_equal(
pre_fit_accuracy, 0.32, decimal=0.06,
)
classifier.fit_generator(generator=data_gen, nb_epochs=2)
predictions = classifier.predict(x_test_mnist)
prediction_class = np.argmax(predictions, axis=1)
post_fit_accuracy = np.sum(prediction_class == true_class) / x_test_mnist.shape[0]
np.testing.assert_array_almost_equal(
post_fit_accuracy, 0.68, decimal=0.06,
)
def test_loss_gradient(
framework,
is_tf_version_2,
get_default_mnist_subset,
After Change
def test_fit_image_generator(
framework, is_tf_version_2, get_image_classifier_list, image_data_generator, get_default_mnist_subset
):
try:
if framework == "tensorflow" and is_tf_version_2:
return
classifier, sess = get_image_classifier_list(one_classifier=True, from_logits=True)
data_gen = image_data_generator(sess=sess)
(_, _), (x_test_mnist, y_test_mnist) = get_default_mnist_subset
true_class = np.argmax(y_test_mnist, axis=1)
predictions = classifier.predict(x_test_mnist)
prediction_class = np.argmax(predictions, axis=1)
pre_fit_accuracy = np.sum(prediction_class == true_class) / x_test_mnist.shape[0]
np.testing.assert_array_almost_equal(
pre_fit_accuracy, 0.32, decimal=0.06,
)
classifier.fit_generator(generator=data_gen, nb_epochs=2)
predictions = classifier.predict(x_test_mnist)
prediction_class = np.argmax(predictions, axis=1)
post_fit_accuracy = np.sum(prediction_class == true_class) / x_test_mnist.shape[0]
np.testing.assert_array_almost_equal(
post_fit_accuracy, 0.68, decimal=0.06,
)
except NotImplementedError as e:
warnings.warn(UserWarning(e))
def test_loss_gradient(
framework,
is_tf_version_2,
get_default_mnist_subset,
In pattern: SUPERPATTERN
Frequency: 10
Non-data size: 6
Instances
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 90f779c858aadaeb2b0621ba23e57967ef27d4d2
Time: 2020-08-05
Author: killian.levacher@ibm.com
File Name: tests/estimators/classification/test_common_deeplearning.py
Class Name:
Method Name: test_fit_image_generator
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 90f779c858aadaeb2b0621ba23e57967ef27d4d2
Time: 2020-08-05
Author: killian.levacher@ibm.com
File Name: tests/estimators/classification/test_common_deeplearning.py
Class Name:
Method Name: test_shapes
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 3f5d1c6d78fba96c8e9135fcf777f042de7feec7
Time: 2020-07-23
Author: killian.levacher@ibm.com
File Name: tests/estimators/classification/test_common_deeplearning.py
Class Name:
Method Name: test_fit
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 3f5d1c6d78fba96c8e9135fcf777f042de7feec7
Time: 2020-07-23
Author: killian.levacher@ibm.com
File Name: tests/estimators/classification/test_common_deeplearning.py
Class Name:
Method Name: test_fit_image_generator
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 90f779c858aadaeb2b0621ba23e57967ef27d4d2
Time: 2020-08-05
Author: killian.levacher@ibm.com
File Name: tests/estimators/classification/test_common_deeplearning.py
Class Name:
Method Name: test_fit
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 3f5d1c6d78fba96c8e9135fcf777f042de7feec7
Time: 2020-07-23
Author: killian.levacher@ibm.com
File Name: tests/estimators/classification/test_common_deeplearning.py
Class Name:
Method Name: test_nb_classes
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 90f779c858aadaeb2b0621ba23e57967ef27d4d2
Time: 2020-08-05
Author: killian.levacher@ibm.com
File Name: tests/estimators/classification/test_common_deeplearning.py
Class Name:
Method Name: test_input_shape
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 90f779c858aadaeb2b0621ba23e57967ef27d4d2
Time: 2020-08-05
Author: killian.levacher@ibm.com
File Name: tests/estimators/classification/test_common_deeplearning.py
Class Name:
Method Name: test_nb_classes
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 3f5d1c6d78fba96c8e9135fcf777f042de7feec7
Time: 2020-07-23
Author: killian.levacher@ibm.com
File Name: tests/estimators/classification/test_common_deeplearning.py
Class Name:
Method Name: test_input_shape
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 3f5d1c6d78fba96c8e9135fcf777f042de7feec7
Time: 2020-07-23
Author: killian.levacher@ibm.com
File Name: tests/estimators/classification/test_common_deeplearning.py
Class Name:
Method Name: test_shapes