Variables
In the previous sections, we learned how to define tensor objects of different types, such as constants, operations, and placeholders. The values of parameters need to be held in an updatable memory location while building and training models with TensorFlow. Such updatable memory locations for tensors are known as variables in TensorFlow.
To summarize this, TensorFlow variables are tensor objects in that their values can be modified during the execution of the program.
Although tf.Variable seems to be similar to tf.placeholder, they have certain differences. These are listed in the following table:
|
tf.placeholder |
tf.Variable |
|
tf.placeholder defines the input data that does not get updated over time |
tf.Variable defines ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access