class_docstr: This class tests the BlackBox Neural Network classifier.
class_docstr_tok: ["This","class","tests","the","BlackBox","Neural","Network","classifier","."]
code: def test_defences_predict(self):
      clip_values = (0, 1)
      fs = FeatureSqueezing(clip_values=clip_values, bit_depth=2)
      jpeg = JpegCompression(
          clip_values=clip_values, apply_predict=True
      )
      smooth = SpatialSmoothing()
      classifier = get_classifier_bb_nn(defences=[fs, jpeg, smooth])
      self.assertEqual(len(classifier.preprocessing_defences), 3)
  
      predictions_classifier = classifier.predict(self.x_test_mnist)
  
      # Apply the same defences by hand
      x_test_defense = self.x_test_mnist
      x_test_defense, _ = fs(x_test_defense, self.y_test_mnist)
      x_test_defense, _ = jpeg(x_test_defense, self.y_test_mnist)
      x_test_defense, _ = smooth(x_test_defense, self.y_test_mnist)
      classifier = get_classifier_bb_nn()
      predictions_check = classifier.predict(x_test_defense)
  
      # Check that the prediction results match
      np.testing.assert_array_almost_equal(
          predictions_classifier, predictions_check, decimal=4
      )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import tempfile
  import unittest
  import numpy
  from art.defences.preprocessor import FeatureSqueezing, JpegCompression, SpatialSmoothing
  from tests.utils import TestBase, get_classifier_bb, get_classifier_bb_nn
label_desc: Use image node_id 4 for calling the TestBlackBoxClassifierNeuralNetwork obj's underlying member method code with example usage: obj.test_defences_predict() without return types