docstr: Second test for Keras.
  :return:
docstr_tok: ["Second","test","for","Keras",".",":","return",":"]
code: def test_keras_iris(self):
      """
      Second test for Keras.
      :return:
      """
      # Build KerasClassifier
      victim_krc = get_tabular_classifier_kr()
  
      # Create simple CNN
      model = Sequential()
      model.add(Dense(10, input_shape=(4,), activation="relu"))
      model.add(Dense(10, activation="relu"))
      model.add(Dense(3, activation="softmax"))
      try:
          from keras.optimizers.legacy import Adam
  
          optimizer = Adam(lr=0.001)
      except ImportError:
          from keras.optimizers import adam_v2
  
          optimizer = adam_v2.Adam(lr=0.001)
      model.compile(
          loss="categorical_crossentropy",
          optimizer=optimizer,
          metrics=["accuracy"],
      )
  
      # Get classifier
      thieved_krc = KerasClassifier(
          model,
          clip_values=(0, 1),
          use_logits=False,
          channels_first=True,
      )
  
      # Create attack
      copycat_cnn = CopycatCNN(
          classifier=victim_krc,
          batch_size_fit=self.batch_size,
          batch_size_query=self.batch_size,
          nb_epochs=NB_EPOCHS,
          nb_stolen=NB_STOLEN,
      )
      thieved_krc = copycat_cnn.extract(
          x=self.x_train_iris, thieved_classifier=thieved_krc
      )
  
      victim_preds = np.argmax(
          victim_krc.predict(x=self.x_train_iris[:100]), axis=1
      )
      thieved_preds = np.argmax(
          thieved_krc.predict(x=self.x_train_iris[:100]), axis=1
      )
      acc = np.sum(victim_preds == thieved_preds) / len(victim_preds)
  
      self.assertGreater(acc, 0.3)
  
      # Clean-up
      k.clear_session()
  
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 3 for calling the TestCopycatCNNVectors obj's underlying member method code with example usage: obj.test_keras_iris() without return types