pytorch-lightning icon indicating copy to clipboard operation
pytorch-lightning copied to clipboard

Plotting multiple metrics in a single graph

Open gabhinav001 opened this issue 6 years ago • 3 comments

🚀 Feature

Can we have multiple metrics plotted on the same graph in Tensorboard logging done by lightning? That is plotting the dictionary values returned in log_dict in the same graph.

Motivation

Pitch

Alternatives

Additional context

gabhinav001 avatar Oct 07 '20 08:10 gabhinav001

Hi! thanks for your contribution!, great first issue!

github-actions[bot] avatar Oct 07 '20 08:10 github-actions[bot]

You can already do this in lightning, by calling the tensorboard logger yourself, using the add_scalars method. If you insert this into your code (artificial example)

        self.logger.experiment.add_scalars('main_tag', 
                                           {'metric1': loss, 
                                            'metric2': loss+1}, 
                                           global_step=self.global_step)

it will produce this in tensorboard Screenshot from 2020-10-07 12-03-25 where the metrics are shown in the same plot.

SkafteNicki avatar Oct 07 '20 10:10 SkafteNicki

Thank you so much!

gabhinav001 avatar Oct 07 '20 10:10 gabhinav001