Tensorboard- superimpose 2 plots

拟墨画扇 提交于 2019-12-19 19:52:07

问题


In tensorboard, I would like to superimpose 2 plots on the same graph (training and validation losses of a neural network).

I can see 2 separate plots, but not one plot with 2 superimposed curves. Otherwise, I get one plot in zigzag.

How can I do?


回答1:


It is possible to superimpose two plots in Tensorboard. You'll have to satisfy both of the following:

  1. Create two separate tf.train.SummaryWriter objects such that it outputs in two folders.

  2. Create two summaries (e.g. tf.scalar_summary) with the same name.

For example to plot training and validation loss:

# Before training
train_summary = tf.scalar_summary('Loss', train_loss)
vali_summary = tf.scalar_summary('Loss', vali_loss)
train_writer = tf.train.SummaryWriter('/tmp/train'), sess.graph)
vali_writer = tf.train.SummaryWriter('/tmp/vali'), sess.graph)

# And then later
train_writer.add_summary(...)
vali_writer.add_summary(...)



回答2:


If you point tensorboard at the directory containing the tf events for both runs, you should be able to see them. (if you have them in subdirectories, point it to the parent of both).



来源:https://stackoverflow.com/questions/34799850/tensorboard-superimpose-2-plots

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!