class_docstr: Epoch iterator used in the training phase of the model.
code: def __iter__(self):
      self.callback.on_train_begin({})
      for epoch in range(self.initial_epoch, self.epochs + 1):
          self.callback.on_epoch_begin(epoch, {})
          epoch_begin_time = timeit.default_timer()
  
          train_step_iterator = StepIterator(
              self.train_generator,
              self.steps_per_epoch,
              self.batch_metrics_names,
              self.epoch_metrics_names,
              self.callback,
              mode="train",
          )
  
          valid_step_iterator = None
          if self.valid_generator is not None:
              valid_step_iterator = StepIterator(
                  self.valid_generator,
                  self.validation_steps,
                  self.batch_metrics_names,
                  self.epoch_metrics_names,
                  self.callback,
                  mode="val",
              )
  
          yield train_step_iterator, valid_step_iterator
  
          epoch_total_time = timeit.default_timer() - epoch_begin_time
  
          val_metrics_log = (
              {}
              if valid_step_iterator is None
              else valid_step_iterator.metrics_logs
          )
          epoch_log = {
              "epoch": epoch,
              "time": epoch_total_time,
              **train_step_iterator.metrics_logs,
              **val_metrics_log,
          }
          self.callback.on_epoch_end(epoch, epoch_log)
  
          self.epoch_logs.append(epoch_log)
  
          if self.model.stop_training:
              break
  
      self.callback.on_train_end({})
  
file_path: poutyne/poutyne/framework/iterators.py
imports: import itertools
  import timeit
label_desc: Use image node_id 3 for calling the EpochIterator obj's underlying member method code with example usage: obj.__iter__() without return types