Visualizing the graph with TensorBoard
A great feature of TensorFlow is TensorBoard, which is a module for visualizing the graph as well as visualizing the learning of a model. Visualizing the graph allows us to see the connection between nodes, explore their dependencies, and debug the model if needed.
So let's visualize a network that we've already built, one which consists of a generator and a classifier part. We'll repeat some code that we previously used for defining the helper functions. So, revisit the Reusing variables section earlier in this chapter, for the function definitions of build_generator
and build_classifier
. Using these two helper functions, we will build the graph as follows:
>>> batch_size=64 >>> g = tf.Graph() >>> >>> with g.as_default(): ... tf_X = tf.placeholder(shape=(batch_size, 100), ... dtype=tf.float32, ... name='tf_X') ... ... ## build the generator ... with tf...