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

Adopt or not to adopt tensorboard native hyperparameters recording #184

Open
2 tasks done
Tracked by #115
vwxyzjn opened this issue May 12, 2022 · 1 comment
Open
2 tasks done
Tracked by #115

Adopt or not to adopt tensorboard native hyperparameters recording #184

vwxyzjn opened this issue May 12, 2022 · 1 comment

Comments

@vwxyzjn
Copy link
Owner

vwxyzjn commented May 12, 2022

Problem Description

The current way of adding hyperparameters is to do it via markdown text:

writer = SummaryWriter(f"runs/{run_name}")
writer.add_text(
    "hyperparameters",
    "|param|value|\n|-|-|\n%s" % ("\n".join([f"|{key}|{value}|" for key, value in vars(args).items()])),
)

It is however to use the tensorboard native hyperparameters plugin, which unfortunately also has ugly code... see pytorch/pytorch#37738 (comment)

writer = SummaryWriter(f"runs/{run_name}")
from torch.utils.tensorboard.summary import hparams
exp, ssi, sei = hparams(vars(args), metric_dict={"charts/episodic_return": 0})   
writer.file_writer.add_summary(exp)                 
writer.file_writer.add_summary(ssi)                 
writer.file_writer.add_summary(sei)  

produces the following demo, which I guess is pretty cool

Screen.Recording.2022-05-11.at.11.45.43.PM.mov

Checklist

CC @araffin and @Miffyli and who might be interested in this hidden feature.

@vwxyzjn vwxyzjn changed the title Adopt tensorboard native hyperparameters recording Adopt or not to adopt tensorboard native hyperparameters recording May 12, 2022
@araffin
Copy link

araffin commented May 13, 2022

You may have a look at DLR-RM/stable-baselines3#428 (comment) too

@vwxyzjn vwxyzjn mentioned this issue Jun 20, 2022
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants