edflow.edsetup_files.iterator module

Summary

Classes:

Iterator

Clean iterator skeleton for initialization.

Reference

class edflow.edsetup_files.iterator.Iterator(*args, **kwargs)[source]

Bases: edflow.iterators.template_iterator.TemplateIterator

Clean iterator skeleton for initialization.

__init__(*args, **kwargs)[source]

Constructor.

Parameters
  • model (object) – Model class.

  • num_epochs (int) – Number of times to iterate over the data.

  • hooks (list) – List containing Hook instances.

  • hook_freq (int) – Frequency at which hooks are evaluated.

  • bar_position (int) – Used by tqdm to place bars at the right position when using multiple Iterators in parallel.

save(checkpoint_path)[source]

Function for saving the model at a given state :param checkpoint_path: :type checkpoint_path: The path where the saved checkpoint should lie.

restore(checkpoint_path)[source]

Function for model restoration from a given checkpoint. :param checkpoint_path: :type checkpoint_path: The path where the checkpoint for restoring lies.

Returns

Return type

The restored model from the given checkpoint.

step_op(model, **kwargs)[source]

The main method to be called for training by the iterator. Calculating the loss, optimizer step etc. :param model: :type model: The given model class.

Returns

Return type

A dictionary with train_op, log_op and eval_op keys and their returns as their values.