class_docstr: Manages a TensorFlow model for training.
class_docstr_tok: ["Manages","a","TensorFlow","model","for","training","."]
docstr: Runs a training epoch and updates the model parameters.
docstr_tok: ["Runs","a","training","epoch","and","updates","the","model","parameters","."]
code: def step(
      self,
      data_creator,
      epochs=1,
      batch_size=32,
      verbose=1,
      callbacks=None,
      validation_data_creator=None,
      class_weight=None,
      steps_per_epoch=None,
      validation_steps=None,
      validation_freq=1,
      data_config=None,
  ):
      """Runs a training epoch and updates the model parameters."""
      config = self.config.copy()
      if data_config is not None:
          config.update(data_config)
      config["batch_size"] = batch_size
  
      with self.strategy.scope():
          dataset_handler = DatasetHandler.get_handler(
              self.backend, self.rank, self.size
          )
          (
              train_dataset,
              test_dataset,
          ) = dataset_handler.handle_datasets_train(
              data_creator,
              validation_data_creator,
              config=config,
              epochs=epochs,
              steps_per_epoch=steps_per_epoch,
              validation_steps=validation_steps,
          )
      # process other arguments
      if self.backend == "horovod":
          import horovod.tensorflow.keras as hvd
  
          hvd_callbacks = [
              hvd.callbacks.BroadcastGlobalVariablesCallback(0),
              hvd.callbacks.MetricAverageCallback(),
          ]
          if hvd.rank() != 0:
              verbose = 0
  
          if callbacks is not None:
              callbacks = hvd_callbacks + callbacks
          else:
              callbacks = hvd_callbacks
      elif self.backend == "tf-distributed":
          if self.strategy.cluster_resolver.task_id != 0:
              verbose = 0
  
      history = self.model.fit(
          train_dataset,
          epochs=self.epoch + epochs,
          verbose=verbose,
          callbacks=callbacks,
          validation_data=test_dataset,
          class_weight=class_weight,
          initial_epoch=self.epoch,
          steps_per_epoch=steps_per_epoch,
          validation_steps=validation_steps,
          validation_freq=validation_freq,
      )
      if history is None:
          stats = {}
      else:
          stats = {
              "train_" + k: v[-1] for k, v in history.history.items()
          }
  
      self.epoch += epochs
      return [stats]
  
imports: import logging
  import json
  import os
  import numpy
  import ray
  from contextlib import closing
  import logging
  import socket
  from zoo.orca.data.utils import ray_partitions_get_data_label
label_desc: Use image node_id 6 for calling the TFRunner obj's underlying member method code with example usage: obj.step(data_creator, epochs, batch_size, verbose, callbacks, validation_data_creator, class_weight, steps_per_epoch, validation_steps, validation_freq, data_config) and returns: list