A rank-4 tensor has four dimensions. It is formed by stacking rank-3 tensors along an additional dimension, producing a higher-dimensional array of numbers. section 2.2.4
Images in a batch
Image data commonly uses rank-4 tensors with shape (samples, height, width, channels). Each sample is a two-dimensional pixel grid, and each pixel is represented by a vector of channel values. section 2.2.8
Use the axes to distinguish the data structure:
- samples identifies the images collected together. section 2.2.8
- height and width identify each image's pixel grid. section 2.2.8
- channels identify the values associated with each pixel. section 2.2.8
- Video data adds another dimension, becoming rank 5 with shape (samples, frames, height, width, channels). section 2.2.8
Figure 2.3 A rank-4 image data tensor
Use the figure to visualize how image samples, pixels, and channels occupy the four axes. section 2.2.8
