In [ ]:
import tensorflow as tf
a = tf.add(1, 2,)
b = tf.multiply(a, 3)
c = tf.add(4, 5,)
d = tf.multiply(c, 6,)
e = tf.multiply(4, 5,)
f = tf.div(c, 6,)
g = tf.add(b, d)
h = tf.multiply(g, f)
with tf.Session() as sess:
writer = tf.summary.FileWriter("/tmp/tboard/output", sess.graph)
print(sess.run(h))
writer.close()
In [ ]:
## To see visualization
# tensorboard --logdir=/tmp/tboard/output
In [13]:
### Adding names to the nodes
import tensorflow as tf
a = tf.add(1, 2, name="Add_these_numbers")
b = tf.multiply(a, 3)
c = tf.add(4, 5, name="And_These_ones")
d = tf.multiply(c, 6, name="Multiply_these_numbers")
e = tf.multiply(4, 5, name="B_add")
f = tf.div(c, 6, name="B_mul")
g = tf.add(b, d)
h = tf.multiply(g, f)
with tf.Session() as sess:
writer = tf.summary.FileWriter("/tmp/tboard/output2", sess.graph)
print(sess.run(h))
writer.close()
In [2]:
import tensorflow as tf
with tf.name_scope("MyOperationGroup"):
with tf.name_scope("Scope_A"):
a = tf.add(1, 2, name="Add_these_numbers")
b = tf.multiply(a, 3)
with tf.name_scope("Scope_B"):
c = tf.add(4, 5, name="And_These_ones")
d = tf.multiply(c, 6, name="Multiply_these_numbers")
with tf.name_scope("Scope_C"):
e = tf.multiply(4, 5, name="B_add")
f = tf.div(c, 6, name="B_mul")
g = tf.add(b, d)
h = tf.multiply(g, f)
with tf.Session() as sess:
writer = tf.summary.FileWriter("/tmp/tboard/output3", sess.graph)
print(sess.run(h))
writer.close()
In [20]:
import tensorflow as tf
a = tf.multiply(2, 2,)
b = tf.multiply(3, 3,)
c = tf.multiply(4, 4,)
d = tf.add(a,b,)
e = tf.add(d,c,)
f = tf.multiply(2,2,)
g = tf.multiply(f,3,)
h = tf.subtract(e,h,)
i = tf.multiply(2,3,)
j = tf.multiply(j,4,)
k = tf.subtract(j,k,)
l = tf.multiply(2,2,)
m = tf.multiply(l,4,)
n = tf.subtract(l,m)
with tf.Session() as sess:
writer = tf.summary.FileWriter("/tmp/tboard/output_h2", sess.graph)
print(sess.run(f))
writer.close()
In [18]:
import tensorflow as tf
a = tf.multiply(4,4,)
b = tf.multiply(3, 3,)
c = tf.add(16, 9,)
d = tf.multiply(4, a,)
e = tf.multiply(d, b,)
b = tf.subtract(b, e,)
with tf.Session() as sess:
writer = tf.summary.FileWriter("/tmp/tboard/output_h1", sess.graph)
print(sess.run(b))
writer.close()
In [23]:
import tensorflow as tf
with tf.name_scope("MyOperationGroup"):
with tf.name_scope("Scope_A"):
a = tf.multiply(2, 2, name="Multiply_these_numbers")
b = tf.multiply(3, 3)
with tf.name_scope("Scope_B"):
c = tf.add(4, 9, name="And_These_ones")
with tf.name_scope("Scope_C"):
d = tf.multiply(4, a, name="B_mul")
e = tf.multiply(d, b, name="B_mul")
f = tf.add(b, e)
with tf.Session() as sess:
writer = tf.summary.FileWriter("/tmp/tboard/output3", sess.graph)
print(sess.run(f))
writer.close()
In [24]:
import tensorflow as tf
with tf.name_scope("MyOperationGroup"):
with tf.name_scope("Scope_A"):
a = tf.multiply(2, 2, name="Multiply_these_numbers")
b = tf.multiply(3, 3)
c = tf.multiply(4, 4)
with tf.name_scope("Scope_B"):
d = tf.add(a, b, name="And_These_ones")
e = tf.add(d, c, name="And_These_ones")
with tf.name_scope("Scope_C"):
f = tf.multiply(2, 2, name="B_mul")
g = tf.multiply(f, 3, name="B_mul")
with tf.name_scope("Scope_D"):
h = tf.subtract(j, k, name="B_subtract")
with tf.name_scope("Scope_E"):
i = tf.multiply(2, 2, name="B_mul")
j = tf.multiply(l, 4, name="B_mul")
with tf.name_scope("Scope_F"):
k = tf.multiply(2, 2, name="B_mul")
l = tf.multiply(l, 4, name="B_mul")
m = tf.subtract(l, m)
with tf.Session() as sess:
writer = tf.summary.FileWriter("/tmp/tboard/output3", sess.graph)
print(sess.run(m))
writer.close()
In [ ]: