Create the TensorFlow graph that you’d like to collect summary data from, and decide which nodes you would like to annotate with summary operations;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
## summaries
# image summary
tf.image_summary('input', x_reshaped, 10)
# histogram summary
# create two histogram summaries here, summarizing `W` and `b`
tf.histogram_summary('weight', W)
tf.histogram_summary('bias', b)
###### write your code here ######
###### write your code here ######
# scalar summary
# create two scalar summaries here, summarizing `cost` and `accuracy`
tf.scalar_summary('cost', cost)
tf.scalar_summary('accuarcy', accuracy)
###### write your code here ######
###### write your code here ######
Operations in TensorFlow don’t do anything until you run them, neither do summaries. So use tf.merge_summary or tf.merge_all_summaries to combine them into a single op that generates all the summary data;
1
2
# use `tf.merge_all_summaries()` to register the summaries
merged = tf.merge_all_summaries() ###### write your code here ######