July 2019
Intermediate to advanced
512 pages
19h 39m
English
Scoping is used to reduce complexity and helps us to better understand a model by grouping related nodes together. Having a name scope helps us to group similar operations in a graph. It comes in handy when we are building a complex architecture. Scoping can be created using tf.name_scope(). In the previous example, we performed two operations, Product and sum. We can simply group them into two different name scopes as Product and sum.
In the previous section, we saw how prod1 and prod2 perform multiplication and compute the result. We'll define a name scope called Product, and group the prod1 and prod2 operations, as shown in the following code:
with tf.name_scope("Product"): with tf.name_scope("prod1"): prod1 = tf.multiply(x,y,name='prod1') ...Read now
Unlock full access