June 2018
Intermediate to advanced
318 pages
9h 24m
English
Scoping is used to reduce complexity and helps us to better understand the model by grouping the related nodes together. For instance, in the previous example, we can break down our graph into two different groups called computation and result. If you look at the previous example, you can see that nodes a to e perform the computation and node g calculates the result. So we can group them separately using the scope for easy understanding. Scoping can be created using the tf.name_scope() function.
Let's use the tf.name_scope() function using Computation:
with tf.name_scope("Computation"): a = tf.constant(5) b = tf.constant(4) c = tf.multiply(a,b) d = tf.constant(2) e = tf.constant(3) f = tf.multiply(d,e)
Let's use the tf.name_scope() ...
Read now
Unlock full access