hook#
- class pointrix.hook.base_hook.Hook#
Bases:
object
A hook is a base class that can be used to modify the behavior of the trainer.
- after_load_checkpoint(trainner, checkpoint) None #
some operations after the checkpoint is loaded, used for resume training.
- Parameters:
trainner (Trainer) – The trainer object.
checkpoint (Dict) – The checkpoint loaded.
- after_run(trainner) None #
some operations after the training run ends.
- Parameters:
trainner (Trainer) – The trainer object.
- after_train(trainner) None #
some operations after the training loop ends.
- Parameters:
trainner (Trainer) – The trainer object.
- after_train_iter(trainner) None #
some operations after the training iteration ends.
- Parameters:
trainner (Trainer) – The trainer object.
- after_val(trainner) None #
some operations after the validation loop ends.
- Parameters:
trainner (Trainer) – The trainer object.
- after_val_iter(trainner) None #
some operations after the validation iteration ends.
- Parameters:
trainner (Trainer) – The trainer object.
- before_run(trainner) None #
some operations before the training loop starts.
- Parameters:
trainner (Trainer) – The trainer object.
- before_train(trainner) None #
some operations before the training loop starts.
- Parameters:
trainner (Trainer) – The trainer object.
- before_train_iter(trainner) None #
some operations before the training iteration starts.
- Parameters:
trainner (Trainer) – The trainer object.
- before_val(trainner) None #
some operations before the validation loop starts.
- Parameters:
trainner (Trainer) – The trainer object.
- before_val_iter(trainner) None #
some operations before the validation iteration starts.
- Parameters:
trainner (Trainer) – The trainer object.
- exception() None #
some operations when exception occurs.
- class pointrix.hook.checkpoint_hook.CheckPointHook#
Bases:
Hook
A hook to save the checkpoint during the training loop.
- after_train(trainner) None #
some operations after the training loop ends.
- Parameters:
trainner (Trainer) – The trainer object.
- after_train_iter(trainner) None #
some operations after the training iteration ends.
- Parameters:
trainner (Trainer) – The trainer object.
- exception() None #
some operations when exception occurs.
- class pointrix.hook.log_hook.LogHook#
Bases:
Hook
A hook to log the training and validation losses.
- after_train(trainner) None #
some operations after the training loop ends.
- Parameters:
trainner (Trainer) – The trainer object.
- after_train_iter(trainner) None #
some operations after the training iteration ends.
- Parameters:
trainner (Trainer) – The trainer object.
- after_val(trainner) None #
some operations after the validation loop ends.
- Parameters:
trainner (Trainer) – The trainer object.
- after_val_iter(trainner) None #
some operations after the validation iteration ends.
- Parameters:
trainner (Trainer) – The trainer object.
- before_run(trainner) None #
some print operations before the training loop starts.
- Parameters:
trainner (Trainer) – The trainer object.
- before_train(trainner) None #
some operations before the training loop starts.
- Parameters:
trainner (Trainer) – The trainer object.
- before_val(trainner) None #
some operations before the validation loop starts.
- Parameters:
trainner (Trainer) – The trainer object.
- exception() None #
some operations when exception occurs.