Summaries and metrics

TensorBoard is still the default and recommended data logging and visualization tool for TensorFlow. The tf.summary package contains all the required methods to save scalar values, images, plot histograms, distributions, and more.

Together with the tf.metrics package, it is possible to log aggregated data. Metrics are usually measured on mini-batches and not on the whole training/validation/test set: aggregating data while looping on the complete dataset split allows us to measure the metrics correctly.

The objects in the tf.metrics package are stateful, which means they are able to accumulate/aggregate values and return a cumulative result when calling .result().

In the same way as TensorFlow 1.x, to save a summary ...

Get Hands-On Neural Networks with TensorFlow 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.