Source code for tuners.loggers.console

from datetime import datetime
from .base import BaseTunerObserver
from tqdm.autonotebook import tqdm


[docs]class ConsoleLogger(BaseTunerObserver): def __init__(self, tuner): super(ConsoleLogger, self).__init__(tuner) self.ministeps_pbar = tqdm(total=tuner.params["n_samples_per_step"]//tuner.params["sampling_size"]) def __exit__(self, *exc): stamp = datetime.now().strftime("%H:%M:%S (%Y/%m/%d)") print (f"finished at {stamp}")
[docs] def on_parameters_updated(self, params): for k, v in params.items(): print (f"{k}: ", v)
[docs] def on_step_idx_updated(self, s): self.ministeps_pbar.reset()
[docs] def on_ministep_idx_updated(self, s): self.ministeps_pbar.update(1)