class_docstr: Captum Interpretation for Resnet
class_docstr_tok: ["Captum","Interpretation","for","Resnet"]
code: def get_baseline_img(self, img_tensor, baseline_type):
      baseline_img = None
      if baseline_type == "zeros":
          baseline_img = img_tensor * 0
      if baseline_type == "uniform":
          baseline_img = torch.rand(img_tensor.shape)
      if baseline_type == "gauss":
          baseline_img = (
              torch.rand(img_tensor.shape).to(self.dls.device)
              + img_tensor
          ) / 2
      return baseline_img.to(self.dls.device)
  
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 2 for calling the CaptumInterpretation obj's underlying member method code with example usage: obj.get_baseline_img(img_tensor, baseline_type) and returns: baseline_img