Why tensors?
The tensor structure helps us by giving us the freedom to shape the dataset the way we want.
This is particularly helpful when dealing with images, due to the nature of how information in images are encoded.
Thinking about images, it's easy to understand that it has a height and width, so it would make sense to represent the information contained in it with a two-dimensional structure (a matrix)... until you remember that images have colors. To add information about the colors, we need another dimension, and that's when Tensors become particularly helpful.
Images are encoded into color channels; image data is represented in each color's intensity in a color channel at a given point, the most common one being RGB (which means ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access