Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TensorBoardLogger default version creation ascii sortable #19953

Open
jdenhof opened this issue Jun 6, 2024 · 0 comments
Open

Make TensorBoardLogger default version creation ascii sortable #19953

jdenhof opened this issue Jun 6, 2024 · 0 comments
Labels
feature Is an improvement or enhancement needs triage Waiting to be triaged by maintainers

Comments

@jdenhof
Copy link

jdenhof commented Jun 6, 2024

Description & Motivation

Make it so it by default when opening Tensorboard in the default log directory runs are stored in ascending or descending order.

Pitch

The current TensorBoardLogger default version stamping does not provide a graceful view when sorting experiment runs from TensorBoard.

I think this could be easily solved by putting a default parameter for the TensorBoardLogger, something like n_version_placeholders = 4, and changing the default when getting the log_dir:

    def log_dir(self) -> str:
        """The directory for this run's tensorboard checkpoint.

        By default, it is named ``'version_${self.version}'`` but it can be overridden by passing a string value for the
        constructor's version parameter instead of ``None`` or an int.

        """

        # CHANGED else f"version_{self.version}" to  f"version_{self.version:0{self.n_version_placeholders}d}"
        version = self.version if isinstance(self.version, str) else f"version_{self.version:0{self.n_version_placeholders}d}"
        log_dir = os.path.join(self.root_dir, version)
        if isinstance(self.sub_dir, str):
            log_dir = os.path.join(log_dir, self.sub_dir)
        log_dir = os.path.expandvars(log_dir)
        log_dir = os.path.expanduser(log_dir)
        return log_dir

Alternatives

timestamps...? I don't like timestamps as they are messy but would do the trick.

cc @Borda

@jdenhof jdenhof added feature Is an improvement or enhancement needs triage Waiting to be triaged by maintainers labels Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement needs triage Waiting to be triaged by maintainers
Projects
None yet
Development

No branches or pull requests

1 participant