class_docstr: Captum Interpretation for Resnet
class_docstr_tok: ["Captum","Interpretation","for","Resnet"]
code: def visualize(
      self,
      inp,
      metric="IG",
      n_steps=1000,
      baseline_type="zeros",
      nt_type="smoothgrad",
      strides=(3, 4, 4),
      sliding_window_shapes=(3, 15, 15),
  ):
      if metric not in self.supported_metrics:
          raise Exception(
              f"Metric {metric} is not supported. Currently {self.supported_metrics} are only supported"
          )
      tls = L(
          [TfmdLists(inp, t) for t in L(ifnone(self.dls.tfms, [None]))]
      )
      inp_data = list(zip(*(tls[0], tls[1])))[0]
      enc_data, dec_data = self._get_enc_dec_data(inp_data)
      attributions = self._get_attributions(
          enc_data,
          metric,
          n_steps,
          nt_type,
          baseline_type,
          strides,
          sliding_window_shapes,
      )
      self._viz(attributions, dec_data, metric)
  
file_path: fastai/fastai/callback/captum.py
imports: from __future__ import annotations
  import tempfile
  from ..basics import *
  from ipykernel import jsonutil
  from captum.attr import IntegratedGradients, NoiseTunnel, GradientShap, Occlusion
  from captum.attr import visualization
  from matplotlib.colors import LinearSegmentedColormap
  from captum.insights import AttributionVisualizer, Batch
  from captum.insights.attr_vis.features import ImageFeature
label_desc: Use image node_id 3 for calling the CaptumInterpretation obj's underlying member method code with example usage: obj.visualize(inp, metric, n_steps, baseline_type, nt_type, strides, sliding_window_shapes) without return types