class_docstr: Callback for validation loss.
docstr: Initializes the Callback.
  
  Args:
      summarizer: Summarizer to validate.
      val_dataset: Validation dataset to validate the model on.
      loss_function: Loss function to apply to calculate the validation score.
      batch_size: Batch size of the validation dataset, needed for initializing the model.
docstr_tok: ["Initializes","the","Callback",".","Args",":","summarizer",":","Summarizer","to","validate",".","val_dataset",":","Validation","dataset","to","validate","the","model","on",".","loss_function",":","Loss","function","to","apply","to","calculate","the","validation","score",".","batch_size",":","Batch","size","of","the","validation","dataset",",","needed","for","initializing","the","model","."]
code: def __init__(
      self,
      summarizer: Summarizer,
      val_dataset: tf.data.Dataset,
      loss_function: Callable[[tf.Tensor, tf.Tensor], tf.Tensor],
      batch_size: int,
  ) -> None:
      """
      Initializes the Callback.
  
      Args:
          summarizer: Summarizer to validate.
          val_dataset: Validation dataset to validate the model on.
          loss_function: Loss function to apply to calculate the validation score.
          batch_size: Batch size of the validation dataset, needed for initializing the model.
      """
  
      super().__init__()
      self.batch_size = batch_size
      self.summarizer = summarizer
      self.loss_function = loss_function
      self.val_dataset = val_dataset
      self.train_step = summarizer.new_train_step(
          self.loss_function, self.batch_size, apply_gradients=False
      )
  
imports: from typing import Callable
  import tensorflow
  from headliner.model.summarizer import Summarizer
label_desc: Use image node_id 1 to create a new ValidationCallback object from inherited base classes: tf.keras.callbacks with example: obj = ValidationCallback(summarizer, val_dataset, loss_function, batch_size)