Now that you have understood the basics of tensors, this segment will focus on the mathematical operations that you can perform on them. Since TensorFlow is an ML library, it has all the necessary operations that you might need. In the next video, Avishek will explain the overall mathematical capabilities of TensorFlow.
Note: In the video, it is mentioned that the Jupyter Notebook will be used in the demonstration. However, all the demonstrations in this module will be performed using Google Colab.
So, as you saw in the video, TensorFlow has all the capabilities that you might need for building an ML model. Although the objective of this module is to get you comfortable using TensorFlow, it is not possible to cover all of its mathematical functions and capabilities. In this module, we will discuss the fundamental concepts of coding in TensorFlow, although we strongly recommend you to visit the Tensorflow documentation for better coverage. Now, in the next video, the most basic operations, such as addition and subtraction, will be covered.
So, as you saw in the video, TensorFlow supports all the basic mathematical operators, and you can call them by simply using the respective operators. To use the operator commands, you need to ensure that both tensors on which the operations are being carried out have the same dimensions. An error will be thrown if their dimensions are not the same because the operations are performed element-wise. Another point to note is that when you divide any number by 0, TensorFlow is smart enough to give the output ‘infinity’.
The same operations can also be performed using the functions in the TensorFlow library. For example, you can use in place of the addition operator. Similarly, tf.subtract(), tf.multiply() and tf.divide() work exactly as expected. You can visit this page to read about all the available mathematical functions.
Mathematical Operations on Tensors
In the next segment, you will learn about the linear algebra module available in the TensorFlow library.
Report an error