Skip to content

ConsoleLogger

LocalLogger

Bases: Logger

Handles the local logging; the metrics are saved in local .npy files. Inherits from Logger.

Note

The LocalLogger does not handle hyperparameter/config file saving.

Source code in sequel/utils/loggers/console_logger.py
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
class LocalLogger(Logger):
    """Handles the local logging; the metrics are saved in local .npy files. Inherits from Logger.

    Note:
        The LocalLogger does not handle hyperparameter/config file saving.
    """

    def __init__(self):
        """Inits the LocalLogger."""
        super().__init__()
        self.metric_history = MetricHistory()

    def log(self, item, step=None, epoch=None):
        self.metric_history.update(item)

    def log_figure(self, figure, name, step=None, epoch=None):
        pass

    def log_all_results(self):
        """Saves the results in the .npy format.

        This method should be called after fitting.
        """
        print(f"Saving in {get_experiment_root_dir()}")
        self.metric_history.save_metrics(root_dir=get_experiment_root_dir())

__init__()

Inits the LocalLogger.

Source code in sequel/utils/loggers/console_logger.py
53
54
55
56
def __init__(self):
    """Inits the LocalLogger."""
    super().__init__()
    self.metric_history = MetricHistory()

log_all_results()

Saves the results in the .npy format.

This method should be called after fitting.

Source code in sequel/utils/loggers/console_logger.py
64
65
66
67
68
69
70
def log_all_results(self):
    """Saves the results in the .npy format.

    This method should be called after fitting.
    """
    print(f"Saving in {get_experiment_root_dir()}")
    self.metric_history.save_metrics(root_dir=get_experiment_root_dir())