December 2018
Intermediate to advanced
274 pages
7h 46m
English
To keep it simple, let's assume you want two numbers. Now, if you want to write a program in a regular programming language, such as Python, you would use the following:
a = 1
b = 2
print(a+b)
If you run the program, you will see the output as 3, and then you'll see the same implementation on tensorflow:
import tensorflow as tfx = tf.constant(35, name='x')y = tf.Variable(x + 5, name='y')model = tf.global_variables_initializer()with tf.Session() as session: session.run(model) print(session.run(y))
Let me explain the preceding code. First, we are creating a constant with node name x, adding 5 to it, and storing it in another variable/node y. If you can see the output of the console of y at this point, you will find ...
Read now
Unlock full access