class_docstr: Callback for logging Tensorflow training metrics to MLflow.
  
  This callback logs model information at training start, and logs training metrics every epoch or
  every n steps (defined by the user) to MLflow.
  
  Args:
      run: an `mlflow.entities.run.Run` instance, the MLflow run.
      log_every_epoch: bool, If True, log metrics every epoch. If False, log metrics every n
          steps.
      log_every_n_steps: int, log metrics every n steps. If None, log metrics every epoch.
          Must be `None` if `log_every_epoch=True`.
  
  .. code-block:: python
      :caption: Example
  
      from tensorflow import keras
      import mlflow
      import numpy as np
  
      # Prepare data for a 2-class classification.
      data = tf.random.uniform([8, 28, 28, 3])
      label = tf.convert_to_tensor(np.random.randint(2, size=8))
  
      model = keras.Sequential(
          [
              keras.Input([28, 28, 3]),
              keras.layers.Flatten(),
              keras.layers.Dense(2),
          ]
      )
  
      model.compile(
          loss=keras.losses.SparseCategoricalCrossentropy(from_logits=True),
          optimizer=keras.optimizers.Adam(0.001),
          metrics=[keras.metrics.SparseCategoricalAccuracy()],
      )
  
      with mlflow.start_run() as run:
          model.fit(
              data,
              label,
              batch_size=4,
              epochs=2,
              callbacks=[MLflowCallback(run)],
          )
docstr: Log metrics at the end of each epoch.
docstr_tok: ["Log","metrics","at","the","end","of","each","epoch","."]
code: def on_epoch_end(self, epoch, logs=None):
      """Log metrics at the end of each epoch."""
      if not self.log_every_epoch:
          return
      self.metrics_logger.record_metrics(logs, epoch)
  
file_path: mlflow/mlflow/tensorflow/callback.py
imports: from tensorflow import keras
  from mlflow import log_params, log_text
  from mlflow.utils.autologging_utils import BatchMetricsLogger
label_desc: Use image node_id 3 for calling the MLflowCallback obj's underlying member method code with example usage: obj.on_epoch_end(epoch, logs) without return types