Search code examples
machine-learningtensorflowtensorboard

TensorBoard - Plot training and validation losses on the same graph?


Is there a way to plot both the training losses and validation losses on the same graph?

It's easy to have two separate scalar summaries for each of them individually, but this puts them on separate graphs. If both are displayed in the same graph it's much easier to see the gap between them and whether or not they have begin to diverge due to overfitting.

Is there a built in way to do this? If not, a work around way? Thank you much!


Solution

  • The work-around I have been doing is to use two SummaryWriter with different log dir for training set and cross-validation set respectively. And you will see something like this:

    enter image description here