October 2019
Intermediate to advanced
366 pages
12h 4m
English
A graph represents low-level computations in terms of the dependencies between operations. In TensorFlow, you first define a graph, and then create a session that executes the operations in the graph.
The way a graph is built, computed, and optimized in TensorFlow allows a high degree of parallelism, distributed execution, and portability, all very important properties when building machine learning models.
To give you an idea of the structure of a graph produced internally by TensorFlow, the following program produces the computational graph demonstrated in the following diagram:
import tensorflow as tfimport numpy as npconst1 = tf.constant(3.0, name='constant1')var = tf.get_variable("variable1", shape=[1,2], dtype=tf.float32) ...Read now
Unlock full access