Tensor Operations: Zero to Hero
A Tensor is a container that can hold an N dimensional data structure. Neural Networks love numbers. In fact that’s all they understand. GPUs are great at handling numbers. And they can operate on many numbers in parallel. Therefore a key idea in machine learning is to group numbers together and create a Tensor that can be handed over to the GPU. Arrays and tensors An array is a one dimensional data structure and a tensor that has a single dimension is called a rank 1 tensor. A matrix is a two dimensional data structure and a tensor that has two dimensions is called a rank 2 tensor. A stack of matrices can be thought of as a three dimensional data structure and a tensor that three dimensions is called a rank 3 tensor. Enough text, let’s look at some code. ...