张量板-叠加2个图 [英] Tensorboard- superimpose 2 plots

查看:72
本文介绍了张量板-叠加2个图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在张量板上,我想在同一张图上叠加2个图(神经网络的训练和验证损失).

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

我可以看到2个单独的图,但是看不到有2条叠加曲线的图.否则,我会在锯齿形中得到一个积.

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

我该怎么办?

推荐答案

可以在Tensorboard中叠加两个图.您必须满足以下两个条件:

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

  1. 创建两个单独的tf.train.SummaryWriter对象,以使其在两个文件夹中输出.

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

相同的名称创建两个摘要(例如tf.scalar_summary).

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个图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆