Variables, constants, and placeholders are fundamental elements of TensorFlow. However, there is always confusion between these three. Let's look at each element, one by one, and learn the difference between them.
Variables, constants, and placeholders
Variables
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...