class_docstr: Performs the perturbation analysis.
  
  :param analyzer: Analyzer.
  :type analyzer: innvestigate.analyzer.base.AnalyzerBase
  :param model: Trained Keras model.
  :param generator: Data generator.
  :type generator: innvestigate.sequence.BatchSequence
  :param perturbation: Instance of Perturbation class that performs the perturbation.
  :type perturbation: innvestigate.tools.Perturbation
  :param steps: Number of perturbation steps.
  :type steps: int
  :param regions_per_step: Number of regions that are perturbed per step.
  :type regions_per_step: float
  :param recompute_analysis:
      If true, the analysis is recomputed after each perturbation step.
  :type recompute_analysis: bool
  :param verbose: If true, print some useful information, e.g. timing, progress etc.
code: def __init__(
      self,
      analyzer,
      model,
      generator,
      perturbation,
      steps=1,
      regions_per_step=1,
      recompute_analysis=False,
      verbose=False,
  ):
      self.analyzer = analyzer
      self.model = model
      self.generator = generator
      self.perturbation = perturbation
      # if not isinstance(perturbation, Perturbation):
      #     raise TypeError(type(perturbation))
      self.steps = steps
      self.regions_per_step = regions_per_step
      self.recompute_analysis = recompute_analysis
  
      if not self.recompute_analysis:
          # Compute the analysis once in the beginning
          analysis = []
          X = []
          Y = []
          for XX, YY in self.generator:
              X.extend(list(XX))
              Y.extend(list(YY))
              analysis.extend(list(self.analyzer.analyze(XX)))
          X = np.array(X)
          Y = np.array(Y)
          analysis = np.array(analysis)
          self.analysis_generator = isequence.BatchSequence(
              [X, Y, analysis], batch_size=256
          )
      self.verbose = verbose
  
imports: from __future__ import annotations
  import time
  import warnings
  import numpy
  import tensorflow.keras.backend
  import tensorflow.keras.utils
  import innvestigate.utils.sequence
label_desc: Use image node_id 1 to create a new PerturbationAnalysis object  with example: obj = PerturbationAnalysis(analyzer, model, generator, perturbation, steps, regions_per_step, recompute_analysis, verbose)