class_docstr: Class to compute the saliency maps based on the vanilla gradient w.r.t the adjacency and the feature matrix.
  
  Args:
      model (Keras model object): The differentiable graph model object.
          model.input should contain two tensors:
              - features (Numpy array): The placeholder of the feature matrix.
              - adj (Numpy array): The placeholder of the adjacency matrix.
          model.output (Keras tensor): The tensor of model prediction output.
              This is typically the logit or softmax output.
class_docstr_tok: ["Class","to","compute","the","saliency","maps","based","on","the","vanilla","gradient","w.r.t","the","adjacency","and","the","feature","matrix",".","Args",":","model","(","Keras","model","object",")",":","The","differentiable","graph","model","object",".","model.input","should","contain","two","tensors",":","-","features","(","Numpy","array",")",":","The","placeholder","of","the","feature","matrix",".","-","adj","(","Numpy","array",")",":","The","placeholder","of","the","adjacency","matrix",".","model.output","(","Keras","tensor",")",":","The","tensor","of","model","prediction","output",".","This","is","typically","the","logit","or","softmax","output","."]
docstr: Args:
      This function computes the saliency maps (gradients) which measure the importance of each feature to the prediction score of 'class_of_interest'
      for node 'node_id'.
  
      node_id (int): The node ID in the StellarGraph object.
      class_of_interest (int): The  class of interest for which the saliency maps are computed.
      X_val (Numpy array): The feature matrix, we do not directly get it from generator to support the integrated gradients computation.
      A_val (Numpy array): The adjacency matrix, we do not directly get it from generator to support the integrated gradients computation.
  Returns:
      gradients (Numpy array): Returns a vanilla gradient mask for the nodes.
docstr_tok: ["Args",":","This","function","computes","the","saliency","maps","(","gradients",")","which","measure","the","importance","of","each","feature","to","the","prediction","score","of","'class_of_interest'","for","node","'node_id","'",".","node_id","(","int",")",":","The","node","ID","in","the","StellarGraph","object",".","class_of_interest","(","int",")",":","The","class","of","interest","for","which","the","saliency","maps","are","computed",".","X_val","(","Numpy","array",")",":","The","feature","matrix",",","we","do","not","directly","get","it","from","generator","to","support","the","integrated","gradients","computation",".","A_val","(","Numpy","array",")",":","The","adjacency","matrix",",","we","do","not","directly","get","it","from","generator","to","support","the","integrated","gradients","computation",".","Returns",":","gradients","(","Numpy","array",")",":","Returns","a","vanilla","gradient","mask","for","the","nodes","."]
code: def get_node_masks(
      self, node_id, class_of_interest, X_val=None, A_val=None
  ):
      """
      Args:
          This function computes the saliency maps (gradients) which measure the importance of each feature to the prediction score of 'class_of_interest'
          for node 'node_id'.
  
          node_id (int): The node ID in the StellarGraph object.
          class_of_interest (int): The  class of interest for which the saliency maps are computed.
          X_val (Numpy array): The feature matrix, we do not directly get it from generator to support the integrated gradients computation.
          A_val (Numpy array): The adjacency matrix, we do not directly get it from generator to support the integrated gradients computation.
      Returns:
          gradients (Numpy array): Returns a vanilla gradient mask for the nodes.
      """
      out_indices = np.array([[node_id]])
  
      if X_val is None:
          X_val = self.X
      if A_val is None:
          A_val = self.A
      # Execute the function to compute the gradient
      self.set_ig_values(1.0, 0.0)
      if self.is_sparse and not sp.issparse(A_val):
          A_val = sp.lil_matrix(A_val)
      gradients = self.compute_node_gradients(
          [X_val, out_indices, A_val, 0, class_of_interest]
      )
      return gradients[0]
  
file_path: stellargraph/stellargraph/interpretability/saliency_maps/saliency_gat.py
imports: import numpy
  from tensorflow.keras import backend
  import scipy.sparse
  from stellargraph.mapper import FullBatchSequence
  import tensorflow
label_desc: Use image node_id 5 for calling the GradientSaliencyGAT obj's underlying member method code with example usage: obj.get_node_masks(node_id, class_of_interest, X_val, A_val) and returns: gradients