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.
docstr: Computes the analysis and perturbes the input batch accordingly.
  
  :param x: Samples.
  :param analysis: Analysis of x. If None, it is recomputed.
  :type x: numpy.ndarray
docstr_tok: ["Computes","the","analysis","and","perturbes","the","input","batch","accordingly",".",":","param","x",":","Samples",".",":","param","analysis",":","Analysis","of","x",".","If","None",",","it","is","recomputed",".",":","type","x",":","numpy.ndarray"]
code: def compute_on_batch(self, x, analysis=None, return_analysis=False):
      """
      Computes the analysis and perturbes the input batch accordingly.
  
      :param x: Samples.
      :param analysis: Analysis of x. If None, it is recomputed.
      :type x: numpy.ndarray
      """
      if analysis is None:
          analysis = self.analyzer.analyze(x)
  
      x_perturbated = self.perturbation.perturbate_on_batch(x, analysis)
      if return_analysis:
          return x_perturbated, analysis
      return x_perturbated
  
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 2 for calling the PerturbationAnalysis obj's underlying member method code with example usage: obj.compute_on_batch(x, analysis, return_analysis) and returns: x_perturbated, x_perturbated,  analysis