class_docstr: A unittest class for testing the NewtonFool attack.
docstr: First test with the TensorFlowClassifier.
  :return:
docstr_tok: ["First","test","with","the","TensorFlowClassifier",".",":","return",":"]
code: def test_3_tensorflow_mnist(self):
      """
      First test with the TensorFlowClassifier.
      :return:
      """
      x_test_original = self.x_test_mnist.copy()
  
      # Build TensorFlowClassifier
      tfc, sess = get_image_classifier_tf()
  
      # Attack
      nf = NewtonFool(tfc, max_iter=5, batch_size=100, verbose=False)
      x_test_adv = nf.generate(self.x_test_mnist)
  
      self.assertFalse((self.x_test_mnist == x_test_adv).all())
  
      y_pred = tfc.predict(self.x_test_mnist)
      y_pred_adv = tfc.predict(x_test_adv)
      y_pred_bool = y_pred.max(axis=1, keepdims=1) == y_pred
      y_pred_max = y_pred.max(axis=1)
      y_pred_adv_max = y_pred_adv[y_pred_bool]
      self.assertTrue((y_pred_max >= 0.9 * y_pred_adv_max).all())
  
      # 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 numpy
  from art.attacks.evasion.newtonfool import NewtonFool
  from art.estimators.classification.classifier import ClassGradientsMixin
  from art.estimators.classification.keras import KerasClassifier
  from art.estimators.estimator import BaseEstimator
  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 TestNewtonFool obj's underlying member method code with example usage: obj.test_3_tensorflow_mnist() without return types