Following are a few example tensors which we will be frequently using while discussing the transfer learning use cases.
- Time-series data: A typical time-series data will have a time dimension, and the dimension will correspond to features at each time step. For example, an hourly measurement of temperature and humidity in a day is a time-series data that can be represented by a 2D tensor of shape (24, 2). So, a data batch will be represented by a 3D tensor.
- Image data: Images generally have three dimensions: width, height, and color channels. So, it can be represented by a 3D tensor. An image batch is represented by a 4D tensor, as shown in the following figure.
- Video data: A video consists of frames of images. So, to represent a single video, we need one more dimension. A single frame is a color image, and three dimensions are needed to represent a frame. This a video is represented by a 4D tensor of shape (frames, width, height, color channels):
- A data batch as tensor: Suppose we have a batch of 10 images. A binary image such as in MNIST data can be represented by a 2D tensor. For a batch of 10 images, it can be represented by a 3D tensor. The first axes (axis = 0) of this 3D tensor is called the batch dimension.