TF Ops (Part 2)
Explore common TensorFlow operations for manipulating tensors such as transpose, matrix multiplication, reshape, and reduction functions. Understand key linear algebra operations like eigendecomposition, matrix inverse, and least squares solutions to apply in deep learning models effectively.
We'll cover the following...
Common TF ops
Here, we discuss some important TF ops applied to tensors. These include the following:
tf.transpose(): This is for taking the transpose of a tensor.tf.matmul(): This is for matrix (tensor) multiplication.tf.reshape(): This is to change the shape of the tensor.tf.reduce_mean(): This is for reducing a tensor using its mean (equivalent tonp.mean()in NumPy).tf.reduce_sum(): This is for reducing a tensor using its sum (equivalent tonp.sum()in NumPy).tf.reduce_max(): This is for reducing a tensor using its maximum value (equivalent tonp.max()in NumPy).tf.squeeze(): This is to remove dimensions of size 1 from a tensor.tf.slice(): This is to extract a slice of the specified size from an input tensor.tf.tile(): This is for tiling a tensor a number of times along each axis as specified by some multiple.
Line 22: This constructs a tensor by copying an input tensor the number of times in the specified dimensions: ...