July 2019
Intermediate to advanced
512 pages
19h 39m
English
We can also visualize how the loss and accuracy of our model changes during several iterations in TensorBoard. So, we use tf.summary() to get the summary of the variable. Since the loss and accuracy are scalar variables, we use tf.summary.scalar(), as shown in the following code:
tf.summary.scalar("Accuracy", accuracy)tf.summary.scalar("Loss", loss)
Next, we merge all of the summaries we use in our graph, using tf.summary.merge_all(). We do this because when we have many summaries, running and storing them would become inefficient, so we run them once in our session instead of running multiple times:
merge_summary = tf.summary.merge_all()
Read now
Unlock full access