title: How do you make separate curves for test and training in TensorBoard like in the interactive demo?
body: <p>I was looking at <a href="https://www.tensorflow.org/tensorboard/index.html#events" rel="nofollow noreferrer">the interactive demo in tensorflow</a> and it seems that they have separate test and training plots that one can toggle. For example they have separate accuracies for for test and train:</p>
  
  <p><a href="https://i.stack.imgur.com/ldzmd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ldzmd.png" alt="enter image description here"></a></p>
  
  <p>and one can toggle between them:</p>
  
  <p><a href="https://i.stack.imgur.com/JrXXK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JrXXK.png" alt="enter image description here"></a></p>
  
  <p>they even have separate percentile (hist) graphs too:</p>
  
  <p><a href="https://i.stack.imgur.com/3EaHR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3EaHR.png" alt="enter image description here"></a></p>
  
  <p>what is the TensorFlow code that provides such a useful functionality?</p>
  
  <hr>
  
  <p>I tried having both test and train error but I don't get plots like that. This is what I tried:</p>
  
  <pre><code>with open(path+errors_pretty, 'w+') as f_err_msgs:
      with tf.Session() as sess:
          merged = tf.merge_all_summaries()
          writer = tf.train.SummaryWriter(tensorboard_data_dump, sess.graph)
  
          sess.run( tf.initialize_all_variables() )
          for i in xrange(steps):
              ## Create fake data for y = W.x + b where W = 2, b = 0
              #(batch_xs, batch_ys) = get_batch_feed(X_train, Y_train, M, phase_train)
              feed_dict_batch = get_batch_feed(X_train, Y_train, M, phase_train)
              ## Train
              if i%report_error_freq == 0:
                  (summary_str_train,train_error) = sess.run(fetches=[merged, l2_loss], feed_dict=feed_dict_train)
                  (summary_str_test,test_error) = sess.run(fetches=[merged, l2_loss], feed_dict=feed_dict_test)
                  writer.add_summary(summary_str_train, i)
  
                  loss_msg = "Model *%s%s*, step %d/%d, training error %g, test error %g \n"%(model,nb_hidden_layers,i,steps,train_error,test_error)
                  mdl_info_msg = "Opt: %s, BN %s, After %d/%d iteration, Init: %s \n" % (optimization_alg,bn,i,steps,init_type)
                  print_messages(loss_msg, mdl_info_msg)
                  # store results
                  results['train_errors'].append(train_error)
                  results['test_errors'].append(test_error)
                  # write errors to pretty print
                  f_err_msgs.write(loss_msg)
                  f_err_msgs.write(mdl_info_msg)
                  # save mdl
                  #save_path = saver.save(sess, path+'/tmp_mdls/model.ckpt',global_step=i)
                  if mdl_save:
                      save_path = saver.save(sess, path+mdl_dir+'/model.ckpt',global_step=i)
              sess.run(fetches=[merged,train_step], feed_dict=feed_dict_batch)
              #sess.run(train_step, feed_dict={x: batch_xs, y_: batch_ys})
  </code></pre>