Skip to content

[proposal] Add never_show_list to VerboseLogger #414

@ostamand

Description

@ostamand

When logging a lot of metrics, we sometimes don't want to show all of them in the console.
For example, when looking at the means & stds of 10+ activations.

Proposal is to add a never_show_list to VerboseLogger.

class VerboseLogger(Callback):
    def __init__(
        self,
        always_show: List[str] = ["_timers/_fps"],
        never_show: List[str] = []
    ):
        """
        Log params into console
        Args:
            always_show (List[str]): list of metrics to always show
        """
        super().__init__(CallbackOrder.Logger)
        self.tqdm: tqdm = None
        self.step = 0
        self.always_show = always_show
        self.never_show = never_show
        for k in never_show:
            assert k not in always_show      

That way, it is possible to exclude easily metrics for the console logging while keeping them in the logs files for further analysis using TensorBoard or plot_metrics.

act_callback = MonitorActivations(model) 
callbacks=[
    VerboseLogger(never_show=[*act_callback.metrics_mean, *act_callback.metrics_std]),
    act_callback
]

Let me know what you think of this small change.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions