class_docstr: Integrated Gradients is an axiomatic model interpretability algorithm that
  assigns an importance score to each input feature by approximating the
  integral of gradients of the model's output with respect to the inputs
  along the path (straight line) from given baselines / references to inputs.
  
  Baselines can be provided as input arguments to attribute method.
  To approximate the integral we can choose to use either a variant of
  Riemann sum or Gauss-Legendre quadrature rule.
  
  More details regarding the integrated gradients method can be found in the
  original paper:
  https://arxiv.org/abs/1703.01365
class_docstr_tok: ["Integrated","Gradients","is","an","axiomatic","model","interpretability","algorithm","that","assigns","an","importance","score","to","each","input","feature","by","approximating","the","integral","of","gradients","of","the","model","'s","output","with","respect","to","the","inputs","along","the","path","(","straight","line",")","from","given","baselines","\/","references","to","inputs",".","Baselines","can","be","provided","as","input","arguments","to","attribute","method",".","To","approximate","the","integral","we","can","choose","to","use","either","a","variant","of","Riemann","sum","or","Gauss-Legendre","quadrature","rule",".","More","details","regarding","the","integrated","gradients","method","can","be","found","in","the","original","paper",":","https",":","\/\/arxiv.org\/abs\/1703.01365"]
docstr: Args:
  
      forward_func (Callable): The forward function of the model or any
              modification of it
      multiply_by_inputs (bool, optional): Indicates whether to factor
              model inputs' multiplier in the final attribution scores.
              In the literature this is also known as local vs global
              attribution. If inputs' multiplier isn't factored in,
              then that type of attribution method is also called local
              attribution. If it is, then that type of attribution
              method is called global.
              More detailed can be found here:
              https://arxiv.org/abs/1711.06104
  
              In case of integrated gradients, if `multiply_by_inputs`
              is set to True, final sensitivity scores are being multiplied by
              (inputs - baselines).
docstr_tok: ["Args",":","forward_func","(","Callable",")",":","The","forward","function","of","the","model","or","any","modification","of","it","multiply_by_inputs","(","bool",",","optional",")",":","Indicates","whether","to","factor","model","inputs","'","multiplier","in","the","final","attribution","scores",".","In","the","literature","this","is","also","known","as","local","vs","global","attribution",".","If","inputs","'","multiplier","is","n't","factored","in",",","then","that","type","of","attribution","method","is","also","called","local","attribution",".","If","it","is",",","then","that","type","of","attribution","method","is","called","global",".","More","detailed","can","be","found","here",":","https",":","\/\/arxiv.org\/abs\/1711.06104","In","case","of","integrated","gradients",",","if","`","multiply_by_inputs","`","is","set","to","True",",","final","sensitivity","scores","are","being","multiplied","by","(","inputs","-","baselines",")","."]
code: def __init__(
      self,
      forward_func: Callable,
      multiply_by_inputs: bool = True,
  ) -> None:
      r"""
      Args:
  
          forward_func (Callable): The forward function of the model or any
                  modification of it
          multiply_by_inputs (bool, optional): Indicates whether to factor
                  model inputs' multiplier in the final attribution scores.
                  In the literature this is also known as local vs global
                  attribution. If inputs' multiplier isn't factored in,
                  then that type of attribution method is also called local
                  attribution. If it is, then that type of attribution
                  method is called global.
                  More detailed can be found here:
                  https://arxiv.org/abs/1711.06104
  
                  In case of integrated gradients, if `multiply_by_inputs`
                  is set to True, final sensitivity scores are being multiplied by
                  (inputs - baselines).
      """
      GradientAttribution.__init__(self, forward_func)
      self._multiply_by_inputs = multiply_by_inputs
  
file_path: captum/captum/attr/_core/integrated_gradients.py
imports: import typing
  from typing import Any, Callable, List, Tuple, Union
  import torch
  from captum._utils.common import _expand_additional_forward_args, _expand_target, _format_additional_forward_args, _format_output, _is_tuple
  from captum._utils.typing import BaselineType, Literal, TargetType, TensorOrTupleOfTensorsGeneric
  from captum.attr._utils.approximation_methods import approximation_parameters
  from captum.attr._utils.attribution import GradientAttribution
  from captum.attr._utils.batching import _batch_attribution
  from captum.attr._utils.common import _format_input_baseline, _reshape_and_sum, _validate_input
  from captum.log import log_usage
  from torch import Tensor
label_desc: Use image node_id 1 to create a new IntegratedGradients object from inherited base classes: GradientAttribution with example: obj = IntegratedGradients(forward_func, multiply_by_inputs)