class_docstr: Perform Grad CAM algorithm for a given input
  
  Paper: [Grad-CAM: Visual Explanations from Deep Networks
          via Gradient-based Localization](https://arxiv.org/abs/1610.02391)
docstr: Constructor.
  
  Args:
      validation_data (Tuple[np.ndarray, Optional[np.ndarray]]): Validation data
          to perform the method on. Tuple containing (x, y).
      class_index (int): Index of targeted class
      layer_name (str): Targeted layer for GradCAM
      output_dir (str): Output directory path
code: def __init__(
      self,
      validation_data,
      class_index,
      layer_name=None,
      output_dir=Path("./logs/grad_cam"),
      use_guided_grads=True,
  ):
      """
      Constructor.
  
      Args:
          validation_data (Tuple[np.ndarray, Optional[np.ndarray]]): Validation data
              to perform the method on. Tuple containing (x, y).
          class_index (int): Index of targeted class
          layer_name (str): Targeted layer for GradCAM
          output_dir (str): Output directory path
      """
      super().__init__()
      self.validation_data = validation_data
      self.layer_name = layer_name
      self.class_index = class_index
      self.output_dir = Path(output_dir) / datetime.now().strftime(
          "%Y%m%d-%H%M%S.%f"
      )
      self.use_guided_grads = use_guided_grads
      Path.mkdir(Path(self.output_dir), parents=True, exist_ok=True)
  
      self.file_writer = tf.summary.create_file_writer(
          str(self.output_dir)
      )
  
file_path: tf-explain/tf_explain/callbacks/grad_cam.py
imports: from datetime import datetime
  from pathlib import Path
  import numpy
  import tensorflow
  from tensorflow.keras.callbacks import Callback
  from tf_explain.core.grad_cam import GradCAM
label_desc: Use image node_id 1 to create a new GradCAMCallback object from inherited base classes: Callback with example: obj = GradCAMCallback(validation_data, class_index, layer_name, output_dir, use_guided_grads)