class_docstr: Manages a TensorFlow model for training.
class_docstr_tok: ["Manages","a","TensorFlow","model","for","training","."]
docstr: Evaluates the model on the validation data set.
docstr_tok: ["Evaluates","the","model","on","the","validation","data","set","."]
code: def validate(
      self,
      data_creator,
      batch_size=32,
      verbose=1,
      sample_weight=None,
      steps=None,
      callbacks=None,
      data_config=None,
  ):
      """Evaluates the model on the validation data set."""
      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
          )
  
          dataset = dataset_handler.handle_dataset_validation(
              data_creator, config=config, steps=steps
          )
  
      if self.backend == "horovod":
          import horovod.tensorflow.keras as hvd
  
          if hvd.rank() != 0:
              verbose = 0
      elif self.backend == "tf-distributed":
          if self.strategy.cluster_resolver.task_id != 0:
              verbose = 0
  
      params = dict(
          verbose=verbose,
          sample_weight=sample_weight,
          steps=steps,
          callbacks=callbacks,
      )
      results = self.model.evaluate(dataset, **params)
      if results is None:
          # Using local Model since model.evaluate() returns None
          # for MultiWorkerMirroredStrategy
          logger.warning(
              "Running a local model to get validation score."
          )
          self.local_model = self.model_creator(self.config)
          self.local_model.set_weights(self.model.get_weights())
          results = self.local_model.evaluate(dataset, **params)
  
      if isinstance(results, list):
          stats = {
              "validation_" + k: v
              for k, v in zip(self.model.metrics_names, results)
          }
      else:
          stats = {"results": results}
  
      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 7 for calling the TFRunner obj's underlying member method code with example usage: obj.validate(data_creator, batch_size, verbose, sample_weight, steps, callbacks, data_config) and returns: list