tensorboard icon indicating copy to clipboard operation
tensorboard copied to clipboard

Feature: support plotting custom curves over time

Open domef opened this issue 3 years ago • 7 comments

I need to plot custom curves that change over time (at each step I have a different curve). There is the plugin pr_curve that has this feature: you have a slider for the steps and at each step you have a different curve. But there is a big problem, this plugin actually computes and plots only precision-recall curves. Why are these features coupled? Is there a way to plot custom curves over time?

domef avatar Oct 28 '22 08:10 domef

Hi @domef,

I think the Custom Scalar Dashboard is what you are looking for: https://github.com/tensorflow/tensorboard/blob/master/tensorboard/plugins/custom_scalar/README.md

yatbear avatar Oct 28 '22 17:10 yatbear

This is not what I'm looking for. I need the slider of the steps so that I can see how to the curve changes over time.

domef avatar Nov 02 '22 08:11 domef

One workaround would be to save the curve as an image at each step, which should allow you to step through each curve in the time series dashboard.

I will leave this issue open for others to comment or +1 and we can see if many users are asking for this feature.

groszewn avatar Nov 02 '22 16:11 groszewn

One workaround would be to save the curve as an image at each step, which should allow you to step through each curve in the time series dashboard.

I will leave this issue open for others to comment or +1 and we can see if many users are asking for this feature.

Yep, already thought of that, and in fact we are currently plotting the curves with matplotlib.pyplot and logging the figure as an image, but this practice is cursed, here is some additional motivation on why this feature may be useful to have:

  • Logging plots as images is slow, there is a 2D rendering involved.
  • It also ends up using a lot of space. A compressed image large enough to keep the charts readable is almost always orders of magnitude larger than logging a N×2 float array (unless N is huge, but you can always downsample the curves).
  • Poor GUI interaction. You cannot inspect results by panning, cropping, zooming, and neither compare the same curve across multiple runs.
  • You have to manually save the results, otherwise you cannot go back to a structured representation like CSV or JSON to perform additional analysis on logged results.
  • It looks bad, there is no visual consistency between a matplotlib figure rendering and all other plots logged with tensorboard.
  • It is essentially the same as performing version control on your software by saving screenshots of it on your instagram profile.

It also seems to me that you already have all the necessary components to easily implement the logging of custom curves. After all, you already have tools to visualize/interact with 2D plots, even plots with non-temporal values as x-axis, like in the PR curves plugin.

LucaBonfiglioli avatar Nov 02 '22 17:11 LucaBonfiglioli

We appreciate the additional feedback, it definitely helps as we try and prioritize work. I've converted this to a feature request.

groszewn avatar Nov 02 '22 20:11 groszewn

A few previous instances of this request:

  • https://github.com/tensorflow/tensorboard/issues/1110
  • https://github.com/tensorflow/tensorboard/issues/3121

Barring any objections we should probably consolidate these into a single issue for tracking. I was hoping to tackle this as part of revamping the PR curves summary API for TF 2.0 compatibility (https://github.com/tensorflow/tensorboard/issues/2902) but we didn't get that far at that point. I agree this would significantly increase the utility of the PR curves dashboard.

nfelt avatar Nov 04 '22 00:11 nfelt

What's the status of this update

Aryan9101 avatar Aug 25 '24 10:08 Aryan9101