Custom plots in tensorboard

4,090 views
Skip to first unread message

Brett Kuprel

unread,
Jan 29, 2016, 6:49:07 PM1/29/16
to Discuss
Tensorboard is great, but sometimes there are plots I want to make other than scalar or histogram summaries (e.g. a precision recall curve). I have been creating custom plots with pyplot and saving them as .svg files every 100 batches.  It would be nice to show these in tensorboard.  I could load the svg of the plot as an image, convert it to a numpy array, load it into the tensorflow graph with a placeholder node, and then put it into an image summary.  This seems really indirect, and also destroys the vector graphics by converting to pixels.  Is there a better way to show custom plots in tensorboard?

Jimmy

unread,
Jan 29, 2016, 7:33:31 PM1/29/16
to Brett Kuprel, Discuss
Tf and tensor board are used to only show the weights and bias data of trained models as well as the computation graph of the model calculation... A roc curve inherently requires validation splitting and testing... Seems like out of the scope for tb...



Sent from my iPhone

On Jan 29, 2016, at 3:49 PM, Brett Kuprel <brku...@gmail.com> wrote:

Tensorboard is great, but sometimes there are plots I want to make other than scalar or histogram summaries (e.g. a precision recall curve). I have been creating custom plots with pyplot and saving them as .svg files every 100 batches.  It would be nice to show these in tensorboard.  I could load the svg of the plot as an image, convert it to a numpy array, load it into the tensorflow graph with a placeholder node, and then put it into an image summary.  This seems really indirect, and also destroys the vector graphics by converting to pixels.  Is there a better way to show custom plots in tensorboard?

--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@tensorflow.org.
To post to this group, send email to dis...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/7f2b4f35-63bd-4c1c-a704-21a36a63552d%40tensorflow.org.

Mohammed AlQuraishi

unread,
Jan 30, 2016, 6:09:23 PM1/30/16
to Discuss
But the general point stands. It would be nice if there was a way to extend TB with additional custom-made plots that summarize data differently.

Dan Mané

unread,
Feb 2, 2016, 2:37:21 AM2/2/16
to Mohammed AlQuraishi, Discuss
<- One of the TensorBoard developers

At the moment, there's no first-class support for custom plots, embedding them as image summaries is really clever! Although, as you noted, very indirect and sounds painful to maintain.

I'd like to add support for custom plots to TensorBoard, this is something that people request pretty often. However, getting all the details right is non-trivial; would we expose a way to write custom data into the summaries and then choose from a standard selection of pre-created charts on the frontend to display the new data sources, or would it be better to have a plugin system on the frontend where people can mix in their own visualization components (e.g. built with D3)? And what would the APIs look like on both sides?

At the moment, this isn't very high on my priorities; I'm looking more at performance, increasing maintainability of TensorBoard, adding in some new visualizations like true histograms. That said, if anyone wants to write a proposal for how this system should work, I'd be glad to discuss it and it would move us closer to having custom plots.

rick...@gmail.com

unread,
Jan 25, 2017, 9:20:12 AM1/25/17
to Discuss


import tensorflow as tf


tp = [] # the true positive rate list
fp = [] # the false positive rate list
total = len(fp)
writer = tf.train.SummaryWriter("/tmp/tensorboard_roc")
for idx in range(total):
    summt = tf.Summary()
    summt.value.add(tag="roc", simple_value = tp[idx])
    writer.add_summary (summt, tp[idx] * 100) #act as global_step
    writer.flush ()

then start a tensorboard
tensorboard --logdir=/tmp/tensorboard_roc



for details and code, you can visit my blog: http://blog.csdn.net/mao_feng/article/details/54731098

在 2016年1月30日星期六 UTC+8上午7:49:07,Brett Kuprel写道:
Reply all
Reply to author
Forward
0 new messages