class_docstr: Helper class to create tensorboard summaries for the clustering progress.
  
  This class is derived from tf.keras.callbacks.TensorBoard and just adds
  functionality to write histograms with batch-wise frequency.
  
  Arguments:
      log_dir: The path to the directory where the log files are saved
      cluster_update_freq: determines the frequency of updates of the
        clustering histograms. Same behaviour as parameter update_freq of the
        base class, i.e. it accepts `'batch'`, `'epoch'` or integer.
code: def __init__(
      self, log_dir="logs", cluster_update_freq="epoch", **kwargs
  ):
      super(ClusteringSummaries, self).__init__(
          log_dir=log_dir, **kwargs
      )
  
      if not isinstance(log_dir, str) or not log_dir:
          raise ValueError(
              "`log_dir` must be a non-empty string. You passed `log_dir`="
              "{input}.".format(input=log_dir)
          )
  
      self.cluster_update_freq = (
          1 if cluster_update_freq == "batch" else cluster_update_freq
      )
  
      if compat.is_v1_apis():  # TF 1.X
          self.writer = tf.compat.v1.summary.FileWriter(log_dir)
      else:  # TF 2.X
          self.writer = tf.summary.create_file_writer(log_dir)
  
      self.continuous_batch = 0
  
file_path: model-optimization/tensorflow_model_optimization/python/core/clustering/keras/clustering_callbacks.py
imports: import tensorflow
  from tensorflow_model_optimization.python.core.keras import compat
label_desc: Use image node_id 1 to create a new ClusteringSummaries object from inherited base classes: tf.keras.callbacks with example: obj = ClusteringSummaries(log_dir, cluster_update_freq)