O'Reilly logo

Hands-On Natural Language Processing with Python by Rajalingappaa Shanmugamani, Rajesh Arumugam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

TensorBoard

Next, let's use TensorBoard to visualize the graph. Let's update the program of addition to include the instructions for TensorBoard. Any node can be assigned with a name, so that the node can be rendered with a corresponding name in TensorBoard:

  1. In the following snippet, the names 'a', 'b', and 'c' are assigned to the placeholders:
a = tf.Placeholder(tf.int32, name='a')b = tf.Placeholder(tf.int32, name='b')c = tf.add(a, b, name='add')values = {a: 5, b: 3}sess = tf.Session()
  1. The values are created and the session is started, as usual. Then, the summary writer is created, with a file path as an argument. The details needed for the summary will be stored in that file, and can be used to display TensorBoard:
summary_writer ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required