summary is TensorFlow visualization tools, mainly used in the following functions:
1、tf.summary.scalar() 2、 tf.summary.merge_all() 3、tf.summary.FileWriter()
tf.summary.scalar ( 'loss', loss) ## is used to collect data loss, named 'loss'
merge_summary = tf.summary.merge_all () ## This function can all save all of the summary to disk
train_writer = tf.summary.FileWriter (train_save_dir, sess.graph) ## The training process data stored in the specified file filewriter tf.summary.FileWritter (path, sess.graph)
............................. intermediate processing (cross-entropy, parameter optimization, etc.) ........ ...................
step in range(training_step):
train_summary = sess.run (merge_summary, feed_dict = {........}) ## calls sess.run diagram generating step of the training process data
train_writer.add_summary (train_summary, step) ## calls train_writer of add_summary training process and training methods will save a few steps
tf.summary Usage Summary:
1, tf.summary.scalar: scalar used to display information
例如:tf.summary.scalar('mean', mean)
In general picture loss, accuary will be used when this function.
2, tf.summary.histogram: to display the histogram information
For example: tf.summary.histogram ( 'histogram', var)
Normally used to show the distribution of the training process variable
3, tf.summary.distribution: profile, typically used for displaying the distribution of weights
4, tf.summary.text: can write data into text type tensor in the summary of
5, tf.summary.image: output form of an image band image probuf, aggregated data as follows:
'Tag / image / 0', 'tag / image / 1' ..., such as: input / image / 0 and the like.
格式:tf.summary.image(tag, tensor, max_images=3, collections=None, name=Non
6, tf.summary.audio: display audio recorded during training
7, tf.summary.merge_all: merge_all all summary can be saved to disk all to tensorboard display. If there are no special requirements, which generally use a variety of information can be a time of training shows.
格式:tf.summaries.merge_all(key='summaries')
8, tf.summary.FileWriter: specify a file to save FIG.
Format: tf.summary.FileWritter (path, sess.graph)
You can call it add_summary () method to the training process data stored in the file specified filewriter