This a corrected, beautified, and commented versionof code in Hello, Tensorflow! book.
Here are the main corrections:
Before | After |
---|---|
tf. |
tf.summary.scalar(value.op.name, value) |
summaries = tf. |
summaries = tf.summary.merge_all() |
summary_writer = tf. |
summary_writer = tf.summary.FileWriter('log_simple_stats', sess.graph) |
sess.run(tf. |
sess.run(tf.global_variables_initializer()) |