class_docstr: This module implements the Functionally Equivalent Extraction attack for neural networks with two dense layers,
  ReLU activation at the first layer and logits output after the second layer.
  
  | Paper link: https://arxiv.org/abs/1909.01838
class_docstr_tok: ["This","module","implements","the","Functionally","Equivalent","Extraction","attack","for","neural","networks","with","two","dense","layers",",","ReLU","activation","at","the","first","layer","and","logits","output","after","the","second","layer",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1909.01838"]
docstr: Create a `FunctionallyEquivalentExtraction` instance.
  
  :param classifier: A trained ART classifier.
  :param num_neurons: The number of neurons in the first dense layer.
docstr_tok: ["Create","a","`","FunctionallyEquivalentExtraction","`","instance",".",":","param","classifier",":","A","trained","ART","classifier",".",":","param","num_neurons",":","The","number","of","neurons","in","the","first","dense","layer","."]
code: def __init__(
      self,
      classifier: "CLASSIFIER_TYPE",
      num_neurons: Optional[int] = None,
  ) -> None:
      """
      Create a `FunctionallyEquivalentExtraction` instance.
  
      :param classifier: A trained ART classifier.
      :param num_neurons: The number of neurons in the first dense layer.
      """
      super().__init__(estimator=classifier)
      self.num_neurons = num_neurons
      self.num_classes = classifier.nb_classes
      self.num_features = int(np.prod(classifier.input_shape))
  
      self.vector_u = np.random.normal(
          0, 1, (1, self.num_features)
      ).astype(dtype=NUMPY_DTYPE)
      self.vector_v = np.random.normal(
          0, 1, (1, self.num_features)
      ).astype(dtype=NUMPY_DTYPE)
  
      self.critical_points: List[np.ndarray] = []
  
      self.w_0: Optional[
          np.ndarray
      ] = None  # Weight matrix of first dense layer
      self.b_0: Optional[
          np.ndarray
      ] = None  # Bias vector of first dense layer
      self.w_1: Optional[
          np.ndarray
      ] = None  # Weight matrix of second dense layer
      self.b_1: Optional[np.ndarray] = None
  
file_path: adversarial-robustness-toolbox/art/attacks/extraction/functionally_equivalent_extraction.py
imports: import logging
  import os
  from typing import List, Optional, TYPE_CHECKING
  import numpy
  from scipy.optimize import least_squares
  from art.attacks.attack import ExtractionAttack
  from art.estimators.estimator import BaseEstimator, NeuralNetworkMixin
  from art.estimators.classification.classifier import ClassifierMixin
  from art.estimators.classification.keras import KerasClassifier
  from art.estimators.classification.blackbox import BlackBoxClassifier
label_desc: Use image node_id 1 to create a new FunctionallyEquivalentExtraction object from inherited base classes: ExtractionAttack with example: obj = FunctionallyEquivalentExtraction(classifier, num_neurons)