niftynet.engine.application_iteration module¶
Message stores status info of the current iteration.
-
class
IterationMessage
[source]¶ Bases:
object
This class consists of network variables and operations at each iteration. It is generated by the application engine but can be modified by the application as well.
-
current_iter
¶ Current iteration index can be used to create complex schedule for the iterative training/validation/inference procedure.
Returns: integer of iteration
-
ops_to_run
¶ operations (tf graph elements) to be fed into
session.run(...)
. This is currently mainly used for passing network gradient updates ops tosession.run
.To modify the operations, assigns
self.ops_to_run
Returns: a copy of the operation dictionary
-
data_feed_dict
¶ A dictionary that maps graph elements to values to be fed into
session.run(...)
as feed_dict parameterReturns: dictionary of operations
-
current_iter_output
¶ This property stores graph output received by running
session.run()
.Returns:
-
should_stop
¶ Engine check this property after each iteration
This could be modified in by application
application.set_iteration_update()
to create training schedules such as early stopping.Returns: None or a handler that requested to stop the loop
-
phase
¶ A string indicating the phase in train/validation/inference
Returns:
-
is_training
¶ boolean value indicating if the phase is training
Type: return
-
is_validation
¶ boolean value indicating if the phase is validation
Type: return
-
is_inference
¶ boolean value indicating if the phase is inference
Type: return
-
iter_duration
¶ measuring time used from setting self.current_iter to setting self.current_iter_output
Returns: time duration of an iteration
-