class_docstr: Interface for wrappers that augment the input and reduce the analysis.
  
  This class is an interface for wrappers that:
  * augment the input to the analyzer by creating new samples.
  * reduce the returned analysis to match the initial input shapes.
  
  :param subanalyzer: The analyzer to be wrapped.
  :param augment_by_n: Number of samples to create.
code: def analyze(
      self, X: OptionalList[np.ndarray], *args, **kwargs
  ) -> OptionalList[np.ndarray]:
      if self._subanalyzer._analyzer_model is None:
          self.create_analyzer_model()
  
      ns_mode = self._neuron_selection_mode
      if ns_mode == "all":
          return self._subanalyzer.analyze(X, *args, **kwargs)
  
      # As described in the AugmentReduceBase init,
      # both ns_mode "max_activation" and "index" make use
      # of a subanalyzer using neuron_selection_mode="index".
      if ns_mode == "max_activation":
          # obtain max neuron activations over batch
          pred = self._subanalyzer._model.predict(X)
          indices = np.argmax(pred, axis=1)
      elif ns_mode == "index":
          # TODO: make neuron_selection arg or kwarg, not both
          if args:
              indices = list(args).pop(0)
          else:
              indices = kwargs.pop("neuron_selection")
  
      if not self._subanalyzer._neuron_selection_mode == "index":
          raise AssertionError(
              'Subanalyzer neuron_selection_mode has to be "index" '
              'when using analyzer with neuron_selection_mode != "all".'
          )
      # broadcast to match augmented samples.
      indices = np.repeat(indices, self._augment_by_n)
      kwargs["neuron_selection"] = indices
      return self._subanalyzer.analyze(X, *args, **kwargs)
  
imports: from __future__ import annotations
  import numpy
  import tensorflow.keras.backend
  import tensorflow.keras.layers
  import tensorflow.keras.models
  import innvestigate.backend
  import innvestigate.layers
  from innvestigate.analyzer.base import AnalyzerBase
  from innvestigate.analyzer.network_base import AnalyzerNetworkBase
  from innvestigate.backend.types import OptionalList, Tensor
label_desc: Use image node_id 3 for calling the AugmentReduceBase obj's underlying member method code with example usage: obj.analyze(X) and returns: self, self