class_docstr: A unittest class for testing the CopycatCNN attack.
docstr: First test with the TensorFlowClassifier.
  :return:
docstr_tok: ["First","test","with","the","TensorFlowClassifier",".",":","return",":"]
code: def test_tensorflow_classifier(self):
      """
      First test with the TensorFlowClassifier.
      :return:
      """
      # Build TensorFlowClassifiers
      victim_tfc, sess = get_image_classifier_tf()
  
      # Define input and output placeholders
      input_ph = tf.placeholder(tf.float32, shape=[None, 28, 28, 1])
      output_ph = tf.placeholder(tf.int32, shape=[None, 10])
  
      # Define the tensorflow graph
      conv = tf.layers.conv2d(input_ph, 1, 7, activation=tf.nn.relu)
      conv = tf.layers.max_pooling2d(conv, 4, 4)
      flattened = tf.layers.flatten(conv)
  
      # Logits layer
      logits = tf.layers.dense(flattened, 10)
  
      # Train operator
      loss = tf.reduce_mean(
          tf.losses.softmax_cross_entropy(
              logits=logits, onehot_labels=output_ph
          )
      )
      optimizer = tf.train.AdamOptimizer(learning_rate=0.001)
      train = optimizer.minimize(loss)
  
      # TensorFlow session and initialization
      sess.run(tf.global_variables_initializer())
  
      # Create the classifier
      thieved_tfc = TensorFlowClassifier(
          clip_values=(0, 1),
          input_ph=input_ph,
          output=logits,
          labels_ph=output_ph,
          train=train,
          loss=loss,
          learning=None,
          sess=sess,
      )
  
      # Create attack
      copycat_cnn = CopycatCNN(
          classifier=victim_tfc,
          batch_size_query=self.batch_size,
          batch_size_fit=self.batch_size,
          nb_epochs=NB_EPOCHS,
          nb_stolen=NB_STOLEN,
      )
      thieved_tfc = copycat_cnn.extract(
          x=self.x_train_mnist, thieved_classifier=thieved_tfc
      )
  
      victim_preds = np.argmax(
          victim_tfc.predict(x=self.x_train_mnist[:100]), axis=1
      )
      thieved_preds = np.argmax(
          thieved_tfc.predict(x=self.x_train_mnist[:100]), axis=1
      )
      acc = np.sum(victim_preds == thieved_preds) / len(victim_preds)
  
      self.assertGreater(acc, 0.3)
  
      # Clean-up session
      if sess is not None:
          sess.close()
          tf.reset_default_graph()
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import unittest
  import keras
  import keras.backend
  import numpy
  import tensorflow
  import torch
  import torch.nn
  import torch.optim
  from keras.layers import Conv2D, Dense, Flatten, MaxPooling2D
  from keras.models import Sequential
  from art.attacks.extraction.copycat_cnn import CopycatCNN
  from art.estimators.classification.keras import KerasClassifier
  from art.estimators.classification.pytorch import PyTorchClassifier
  from art.estimators.classification.tensorflow import TensorFlowClassifier
  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, master_seed
label_desc: Use image node_id 2 for calling the TestCopycatCNN obj's underlying member method code with example usage: obj.test_tensorflow_classifier() without return types