Defining Variables and Output in TensorFlow
Explore how to define mutable variables in TensorFlow with specific shapes, initial values, and data types. Understand variable naming conventions and how to create outputs derived from tensors, enabling you to manage model parameters and computational graphs efficiently.
We'll cover the following...
Defining variables in TensorFlow
Variables play an important role in TensorFlow. A variable is essentially a tensor with a specific shape defining how many dimensions the variable will have and the size of each dimension. However, unlike a regular TensorFlow tensor, variables are mutable, meaning that the value of the variables can change after they are defined. This is an ideal property to have to implement the parameters of a learning model (for example, neural network weights), where the weights change slightly after each step of learning. For example, if we define a variable with x = ...