July 2018
Beginner to intermediate
406 pages
9h 55m
English
Graphs are central to TensorFlow, as we saw by the definition of TensorFlow. The default graph contains the structure between objects (placeholders, variables, or constants) as well as the type of these objects (variables are, for instance, trainable variables and all the trainable variables can be retrieved by calling tf.trainable_variables()).
It is possible to change the default graph by using the with construct:
g = tf.Graph()with g.as_default(): c = tf.constant("Node in g")
So each time we call a TensorFlow function, we add nodes to the default graph (whether we are in a block or not). A graph on its own doesn't do anything. No operation is actually done when we create a new layer, use a metric, or create a placeholder. The ...
Read now
Unlock full access