class_docstr: Classes provides an iteration message generator function.
  The generator should yield IterationMessage instances.
class_docstr_tok: ["Classes","provides","an","iteration","message","generator","function",".","The","generator","should","yield","IterationMessage","instances","."]
code: def __call__(self):
      if not self.is_training_action:
          return _infer_iter_generator()
      return _train_iter_generator(
          initial_iter=self.initial_iter,
          final_iter=self.final_iter,
          validation_every_n=self.validation_every_n,
          validation_max_iter=self.validation_max_iter,
      )
  
imports: import itertools
  import time
  from niftynet.engine.application_variables import CONSOLE, TF_SUMMARIES
  from niftynet.engine.signal import TRAIN, VALID, INFER
  from niftynet.utilities.util_common import look_up_operations
label_desc: Use image node_id 2 for calling the IterationMessageGenerator obj's underlying member method code with example usage: obj.__call__() and returns: _train_iter_generator, _infer_iter_generator