class_docstr: Trains Keras models.
class_docstr_tok: ["Trains","Keras","models","."]
code: def work_units(
      self, previous_phase: DatasetProvider
  ) -> Iterator[WorkUnit]:
      self._train_dataset = previous_phase.get_train_dataset()
      self._eval_dataset = previous_phase.get_eval_dataset()
      models = self._models
      if callable(models):
          models = models()
      for model in models:
          yield KerasTrainerWorkUnit(
              model,
              self._train_dataset,
              self._eval_dataset,
              self._storage,
          )
  
file_path: adanet/adanet/experimental/phases/keras_trainer_phase.py
imports: from typing import Callable, Iterable, Iterator, Union
  from adanet.experimental.phases.phase import DatasetProvider
  from adanet.experimental.phases.phase import ModelProvider
  from adanet.experimental.storages.in_memory_storage import InMemoryStorage
  from adanet.experimental.storages.storage import Storage
  from adanet.experimental.work_units.keras_trainer_work_unit import KerasTrainerWorkUnit
  from adanet.experimental.work_units.work_unit import WorkUnit
  import tensorflow.compat.v2
label_desc: Use image node_id 2 for calling the KerasTrainerPhase obj's underlying member method code with example usage: obj.work_units(previous_phase) without return types