pytorch_pfn_extras.handler.BaseHandler#
- class pytorch_pfn_extras.handler.BaseHandler(logic, options, *args, **kwargs)#
Bases:
objectBase class of Handler.
Methods
__init__(logic, options, *args, **kwargs)Base class of Handler.
consume_options(options)A method to update options of Handler.
eval_loop_begin(evaluator)A method called before each evaluation step.
eval_loop_end(evaluator)A method called after running all steps of the evaluation.
eval_post_step(evaluator, batch_idx, batch, ...)A method called after each evaluation step.
eval_setup(evaluator, loader)A method called only once when starting a training run.
eval_step(evaluator, batch_idx, batch, ...)Evaluation iteration.
train_cleanup(trainer)A method called only once when compleing a training run.
train_epoch_begin(trainer, loader)A method called when starting a new epoch.
train_epoch_end(trainer)A method called when finishing an epoch.
train_post_step(trainer, batch_idx, batch, ...)A method called after each training step.
train_setup(trainer, loader)A method called only once when starting a training run.
train_step(trainer, batch_idx, batch, ...)A training step.
train_validation_begin(trainer, evaluator)A method called when starting a validation.
train_validation_end(trainer, evaluator)A method called after validation.
- __init__(logic, options, *args, **kwargs)#
Base class of Handler.
- consume_options(options)#
A method to update options of Handler.
Note that the given dict will be modified.
- Parameters:
options (dict) – Option key-values to be set.
- Return type:
None
- eval_loop_begin(evaluator)#
A method called before each evaluation step.
- Parameters:
evaluator (Evaluator) – The evaluator.
- Return type:
None
- eval_loop_end(evaluator)#
A method called after running all steps of the evaluation.
- Parameters:
evaluator (Evaluator) –
- Return type:
None
- eval_post_step(evaluator, batch_idx, batch, outputs)#
A method called after each evaluation step.
- eval_setup(evaluator, loader)#
A method called only once when starting a training run. When evaluator is not given, this method is not called.
- eval_step(evaluator, batch_idx, batch, complete_fn)#
Evaluation iteration.
- train_cleanup(trainer)#
A method called only once when compleing a training run.
- Parameters:
trainer (Trainer) –
- Return type:
None
- train_epoch_begin(trainer, loader)#
A method called when starting a new epoch.
- train_epoch_end(trainer)#
A method called when finishing an epoch.
- Parameters:
trainer (Trainer) –
- Return type:
None
- train_post_step(trainer, batch_idx, batch, outputs)#
A method called after each training step.
- train_setup(trainer, loader)#
A method called only once when starting a training run.
- train_step(trainer, batch_idx, batch, complete_fn)#
A training step.
- train_validation_begin(trainer, evaluator)#
A method called when starting a validation.