nip.trainers.trainer_base.IterationContext#
- class nip.trainers.trainer_base.IterationContext(trainer: Trainer, num_iterations: int)[source]#
Context manager for methods that run for a certain number of iterations.
This context manager should be used in conjunction with the
attach_progress_bardecorator. It manages the progress bar and ensures that the correct number of iterations are run.- Parameters:
Methods Summary
__exit__(exc_type, exc_value, traceback)__init__(trainer, num_iterations)set_description(description)Set the description of the progress bar.
step()Step the progress bar by one iteration.
Methods