July 2019
Intermediate to advanced
512 pages
19h 39m
English
Variables are containers used to store values. Variables are used as input to several other operations in a computational graph. A variable can be created using the tf.Variable() function, as shown in the following code:
x = tf.Variable(13)
Let's create a variable called W, using tf.Variable(), as follows:
W = tf.Variable(tf.random_normal([500, 111], stddev=0.35), name="weights")
As you can see in the preceding code, we create a variable, W, by randomly drawing values from a normal distribution with a standard deviation of 0.35.
What is that parameter called name in tf.Variable()?
It is used to set the name of the variable in the computational graph. So, in the preceding code, Python saves the variable as W but in the TensorFlow ...
Read now
Unlock full access