class_docstr: Base class for TF saliency masks. Alone, this class doesn't do anything.
class_docstr_tok: ["Base","class","for","TF","saliency","masks",".","Alone",",","this","class","does","n't","do","anything","."]
docstr: Returns a mask that is smoothed with the SmoothGrad method.
  
  Args:
    x_value: Input value, not batched.
    feed_dict: (Optional) feed dictionary to pass to the session.run call.
    stdev_spread: Amount of noise to add to the input, as fraction of the
      total spread (x_max - x_min). Defaults to 15%.
    nsamples: Number of samples to average across to get the smooth gradient.
    magnitude: If true, computes the sum of squares of gradients instead of
      just the sum. Defaults to true.
    **kwargs: Additional keyword arguments to be passed to GetMask.
docstr_tok: ["Returns","a","mask","that","is","smoothed","with","the","SmoothGrad","method",".","Args",":","x_value",":","Input","value",",","not","batched",".","feed_dict",":","(","Optional",")","feed","dictionary","to","pass","to","the","session.run","call",".","stdev_spread",":","Amount","of","noise","to","add","to","the","input",",","as","fraction","of","the","total","spread","(","x_max","-","x_min",")",".","Defaults","to","15","%",".","nsamples",":","Number","of","samples","to","average","across","to","get","the","smooth","gradient",".","magnitude",":","If","true",",","computes","the","sum","of","squares","of","gradients","instead","of","just","the","sum",".","Defaults","to","true",".","*","*","kwargs",":","Additional","keyword","arguments","to","be","passed","to","GetMask","."]
code: def GetSmoothedMask(
      self,
      x_value,
      feed_dict=None,
      stdev_spread=0.15,
      nsamples=25,
      magnitude=True,
      **kwargs,
  ):
      """Returns a mask that is smoothed with the SmoothGrad method.
  
      Args:
        x_value: Input value, not batched.
        feed_dict: (Optional) feed dictionary to pass to the session.run call.
        stdev_spread: Amount of noise to add to the input, as fraction of the
          total spread (x_max - x_min). Defaults to 15%.
        nsamples: Number of samples to average across to get the smooth gradient.
        magnitude: If true, computes the sum of squares of gradients instead of
          just the sum. Defaults to true.
        **kwargs: Additional keyword arguments to be passed to GetMask.
      """
      stdev = stdev_spread * (np.max(x_value) - np.min(x_value))
  
      total_gradients = np.zeros_like(x_value)
      for _ in range(nsamples):
          noise = np.random.normal(0, stdev, x_value.shape)
          x_plus_noise = x_value + noise
          grad = self.GetMask(x_plus_noise, feed_dict, **kwargs)
          if magnitude:
              total_gradients += grad * grad
          else:
              total_gradients += grad
  
      return total_gradients / nsamples
  
file_path: saliency/saliency/tf1/base.py
imports: from .None import utils
  import numpy
label_desc: Use image node_id 3 for calling the TF1Saliency obj's underlying member method code with example usage: obj.GetSmoothedMask(x_value, feed_dict, stdev_spread, nsamples, magnitude) and returns: unknown