Tensorboard- superimpose 2 plots

后端 未结 2 1612
礼貌的吻别
礼貌的吻别 2021-01-18 19:27

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 p

2条回答
  •  一生所求
    2021-01-18 19:45

    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(...)
    

提交回复
热议问题