class_docstr: Salience map from Integrated Gradients.
  
  Integrated Gradients is an attribution method originally proposed in
  Sundararajan et al. (https://arxiv.org/abs/1703.01365), which attributes an
  importance value for each input feature based on the gradients of the model
  output with respect to the input. The feature attribution values are
  calculated by taking the integral of gradients along a straight path from a
  baseline to the input being analyzed. The original implementation can be
  found at: https://github.com/ankurtaly/Integrated-Gradients/blob/master/
  BertModel/bert_model_utils.py
  
  This component requires that the following fields in the model spec. Field
  names like `embs` are placeholders; you can call them whatever you like,
  and as with other LIT components multiple segments are supported.
    Output:
      - TokenEmbeddings (`embs`) to return the input embeddings
      - TokenGradients (`grads`) to return gradients w.r.t. `embs`
      - A label field (`target`) to return the label that `grads`
        was computed for. This is usually a CategoryLabel, but can be anything
        since it will just be fed back into the model.
    Input
      - TokenEmbeddings (`embs`) to accept the modified input embeddings
      - A label field to (`target`) to pin the gradient target to the same
        label for all integral steps, since the argmax prediction may change.
class_docstr_tok: ["Salience","map","from","Integrated","Gradients",".","Integrated","Gradients","is","an","attribution","method","originally","proposed","in","Sundararajan","et","al",".","(","https",":","\/\/arxiv.org\/abs\/1703.01365",")",",","which","attributes","an","importance","value","for","each","input","feature","based","on","the","gradients","of","the","model","output","with","respect","to","the","input",".","The","feature","attribution","values","are","calculated","by","taking","the","integral","of","gradients","along","a","straight","path","from","a","baseline","to","the","input","being","analyzed",".","The","original","implementation","can","be","found","at",":","https",":","\/\/github.com\/ankurtaly\/Integrated-Gradients\/blob\/master\/","BertModel\/bert_model_utils.py","This","component","requires","that","the","following","fields","in","the","model","spec",".","Field","names","like","`","embs","`","are","placeholders",";","you","can","call","them","whatever","you","like",",","and","as","with","other","LIT","components","multiple","segments","are","supported",".","Output",":","-","TokenEmbeddings","(","`","embs","`",")","to","return","the","input","embeddings","-","TokenGradients","(","`","grads","`",")","to","return","gradients","w.r.t",".","`","embs","`","-","A","label","field","(","`","target","`",")","to","return","the","label","that","`","grads","`","was","computed","for",".","This","is","usually","a","CategoryLabel",",","but","can","be","anything","since","it","will","just","be","fed","back","into","the","model",".","Input","-","TokenEmbeddings","(","`","embs","`",")","to","accept","the","modified","input","embeddings","-","A","label","field","to","(","`","target","`",")","to","pin","the","gradient","target","to","the","same","label","for","all","integral","steps",",","since","the","argmax","prediction","may","change","."]
code: def meta_spec(self) -> types.Spec:
      return {
          "saliency": types.TokenSalience(
              autorun=self._autorun, signed=True
          )
      }
  
imports: from typing import cast, Optional
  from absl import logging
  from lit_nlp.api import components
  from lit_nlp.api import dataset
  from lit_nlp.api import dtypes
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.components.citrus import utils
  from lit_nlp.lib import utils
  import numpy
label_desc: Use image node_id 10 for calling the IntegratedGradients obj's underlying member method code with example usage: obj.meta_spec() and returns: dict