code: def saliency_map_graph(network):
      """
      Returns tensorflow variables for saliency map.
  
      Parameters
      ----------
      network : network
      image : ndarray
      """
      session = tensorflow_session()
  
      if not hasattr(saliency_map_graph, "cache"):
          saliency_map_graph.cache = {}
  
      if session in saliency_map_graph.cache:
          return saliency_map_graph.cache[session]
  
      inputs = network.inputs
      prediction = network.outputs
  
      output_class = tf.argmax(prediction[0])
      (saliency,) = tf.gradients(tf.reduce_max(prediction), inputs)
  
      # Caching will ensure that we won't build
      # tensorflow graph every time we generate
      saliency_map_graph.cache[session] = inputs, saliency, output_class
      return inputs, saliency, output_class
  
file_path: neupy/neupy/plots/saliency_map.py
imports: import numpy
  import tensorflow
  import matplotlib.pyplot
  from scipy.ndimage.filters import gaussian_filter
  from neupy.utils import tensorflow_session
  from neupy.exceptions import InvalidConnection
  from neupy.algorithms.gd.base import BaseOptimizer
label_desc: Use image node_id 1 for calling a global function with example usage: saliency_map_graph(network) and returns: inputs,  saliency,  output_class, saliency_map_graph