class_docstr: Keras checkpoint callback
  
  Saves checkpoints after each validation step.
  
  Checkpoint are currently not registered if no ``tune.report()`` call
  is made afterwards. Consider using ``TuneReportCheckpointCallback``
  instead.
  
  Args:
      filename: Filename of the checkpoint within the checkpoint
          directory. Defaults to "checkpoint".
      frequency: Checkpoint frequency. If this is an integer `n`,
          checkpoints are saved every `n` times each hook was called. If
          this is a list, it specifies the checkpoint frequencies for each
          hook individually.
      on: When to trigger checkpoint creations. Must be one of
          the Keras event hooks (less the ``on_``), e.g.
          "train_start", or "predict_end". Defaults to "epoch_end".
class_docstr_tok: ["Keras","checkpoint","callback","Saves","checkpoints","after","each","validation","step",".","Checkpoint","are","currently","not","registered","if","no","``","tune.report","(",")","``","call","is","made","afterwards",".","Consider","using","``","TuneReportCheckpointCallback","``","instead",".","Args",":","filename",":","Filename","of","the","checkpoint","within","the","checkpoint","directory",".","Defaults","to","``","checkpoint","''",".","frequency",":","Checkpoint","frequency",".","If","this","is","an","integer","`","n","`",",","checkpoints","are","saved","every","`","n","`","times","each","hook","was","called",".","If","this","is","a","list",",","it","specifies","the","checkpoint","frequencies","for","each","hook","individually",".","on",":","When","to","trigger","checkpoint","creations",".","Must","be","one","of","the","Keras","event","hooks","(","less","the","``","on_","``",")",",","e.g",".","``","train_start","''",",","or","``","predict_end","''",".","Defaults","to","``","epoch_end","''","."]
code: def __init__(
      self,
      filename: str = "checkpoint",
      frequency: Union[int, List[int]] = 1,
      on: Union[str, List[str]] = "epoch_end",
  ):
      if isinstance(frequency, list):
          if not isinstance(on, list) or len(frequency) != len(on):
              raise ValueError(
                  "If you pass a list for checkpoint frequencies, the `on` "
                  "parameter has to be a list with the same length."
              )
  
      self._frequency = frequency
  
      super(_TuneCheckpointCallback, self).__init__(on)
  
      self._filename = filename
      self._counter = Counter()
      self._cp_count = 0
  
file_path: ray/python/ray/tune/integration/keras.py
imports: import os
  from collections import Counter
  from typing import Dict, List, Optional, Union
  from ray import tune
  from ray.util.annotations import Deprecated
  from ray.air.integrations.keras import _Callback
label_desc: Use image node_id 1 to create a new _TuneCheckpointCallback object from inherited base classes: TuneCallback with example: obj = _TuneCheckpointCallback(filename, frequency, on)