class_docstr: Perform Integrated Gradients algorithm for a given input
  
  Paper: [Axiomatic Attribution for Deep Networks](https://arxiv.org/pdf/1703.01365.pdf)
class_docstr_tok: ["Perform","Integrated","Gradients","algorithm","for","a","given","input","Paper",":","[","Axiomatic","Attribution","for","Deep","Networks","]","(","https",":","\/\/arxiv.org\/pdf\/1703.01365.pdf",")"]
docstr: Compute Integrated Gradients for a specific class index
  
  Args:
      validation_data (Tuple[np.ndarray, Optional[np.ndarray]]): Validation data
          to perform the method on. Tuple containing (x, y).
      model (tf.keras.Model): tf.keras model to inspect
      class_index (int): Index of targeted class
      n_steps (int): Number of steps in the path
  
  Returns:
      np.ndarray: Grid of all the integrated gradients
docstr_tok: ["Compute","Integrated","Gradients","for","a","specific","class","index","Args",":","validation_data","(","Tuple","[","np.ndarray",",","Optional","[","np.ndarray","]","]",")",":","Validation","data","to","perform","the","method","on",".","Tuple","containing","(","x",",","y",")",".","model","(","tf.keras.Model",")",":","tf.keras","model","to","inspect","class_index","(","int",")",":","Index","of","targeted","class","n_steps","(","int",")",":","Number","of","steps","in","the","path","Returns",":","np.ndarray",":","Grid","of","all","the","integrated","gradients"]
code: def explain(self, validation_data, model, class_index, n_steps=10):
      """
      Compute Integrated Gradients for a specific class index
  
      Args:
          validation_data (Tuple[np.ndarray, Optional[np.ndarray]]): Validation data
              to perform the method on. Tuple containing (x, y).
          model (tf.keras.Model): tf.keras model to inspect
          class_index (int): Index of targeted class
          n_steps (int): Number of steps in the path
  
      Returns:
          np.ndarray: Grid of all the integrated gradients
      """
      images, _ = validation_data
  
      interpolated_images = IntegratedGradients.generate_interpolations(
          np.array(images), n_steps
      )
  
      integrated_gradients = (
          IntegratedGradients.get_integrated_gradients(
              interpolated_images, model, class_index, n_steps
          )
      )
  
      grayscale_integrated_gradients = (
          transform_to_normalized_grayscale(
              tf.abs(integrated_gradients)
          ).numpy()
      )
  
      grid = grid_display(grayscale_integrated_gradients)
  
      return grid
  
file_path: tf-explain/tf_explain/core/integrated_gradients.py
imports: import numpy
  import tensorflow
  from tf_explain.utils.display import grid_display
  from tf_explain.utils.image import transform_to_normalized_grayscale
  from tf_explain.utils.saver import save_grayscale
label_desc: Use image node_id 1 for calling the IntegratedGradients obj's underlying member method code with example usage: obj.explain(validation_data, model, class_index, n_steps) and returns: grid