code: def test_8_keras_mnist(self):
      x_test_original = self.x_test_mnist.copy()
  
      # Keras classifier
      classifier = get_image_classifier_kr(from_logits=True)
  
      scores = classifier._model.evaluate(
          self.x_train_mnist, self.y_train_mnist
      )
      logger.info(
          "[Keras, MNIST] Accuracy on training set: %.2f%%",
          (scores[1] * 100),
      )
      scores = classifier._model.evaluate(
          self.x_test_mnist, self.y_test_mnist
      )
      logger.info(
          "[Keras, MNIST] Accuracy on test set: %.2f%%",
          (scores[1] * 100),
      )
  
      attack = DeepFool(
          classifier, max_iter=5, batch_size=11, verbose=False
      )
      x_train_adv = attack.generate(self.x_train_mnist)
      x_test_adv = attack.generate(self.x_test_mnist)
  
      self.assertFalse((self.x_train_mnist == x_train_adv).all())
      self.assertFalse((self.x_test_mnist == x_test_adv).all())
  
      train_y_pred = get_labels_np_array(
          classifier.predict(x_train_adv)
      )
      test_y_pred = get_labels_np_array(classifier.predict(x_test_adv))
  
      self.assertFalse((self.y_train_mnist == train_y_pred).all())
      self.assertFalse((self.y_test_mnist == test_y_pred).all())
  
      sum_0 = np.sum(
          np.argmax(train_y_pred, axis=1)
          == np.argmax(self.y_train_mnist, axis=1)
      )
      accuracy_0 = sum_0 / self.y_train_mnist.shape[0]
      logger.info(
          "Accuracy on adversarial train examples: %.2f%%",
          (accuracy_0 * 100),
      )
  
      sum_1 = np.sum(
          np.argmax(test_y_pred, axis=1)
          == np.argmax(self.y_test_mnist, axis=1)
      )
      accuracy_1 = sum_1 / self.y_test_mnist.shape[0]
      logger.info(
          "Accuracy on adversarial test examples: %.2f%%",
          (accuracy_1 * 100),
      )
  
      # Check that x_test has not been modified by attack and classifier
      self.assertAlmostEqual(
          float(np.max(np.abs(x_test_original - self.x_test_mnist))),
          0.0,
          delta=0.00001,
      )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import unittest
  import keras
  import numpy
  from art.attacks.evasion.deepfool import DeepFool
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassGradientsMixin
  from art.estimators.classification.keras import KerasClassifier
  from art.utils import get_labels_np_array
  from tests.attacks.utils import backend_test_classifier_type_check_fail
  from tests.utils import TestBase, get_image_classifier_kr, get_image_classifier_pt, get_image_classifier_tf, get_tabular_classifier_kr, get_tabular_classifier_pt, get_tabular_classifier_tf
label_desc: Use image node_id 2 for calling the TestDeepFool obj's underlying member method code with example usage: obj.test_8_keras_mnist() without return types