Organize the information you need to understand Tensor as your own notes. Today, I will give an example of data used in the real world of deep running. I will introduce how the data is expressed as a tensor.
And please read carefully how each data is expressed as ** Shape ** of tensor.
The previous post is here.
A tensor is a container that holds numbers. It's simple.
The table below shows commonly used data in the real world of deep running and its tensor information.
Data example | name | Tensor | Shape |
---|---|---|---|
Vector Data* | Matrix | 2D Tensor | (sample, feature) |
Time Series Data | 3D Tensor | 3D Tensor | (sample, timestep, feature) |
Images | 4D Tensor | 4D Tensor | (sample, height, width, channel) |
Video | 5D Tensor | 5D Tensor | (sample, frame, height, width, channel) |
3.1. Vector Data(2D Tensor)
Here is an example of data for a list of people. Think of it as some kind of electoral roll. Suppose you have selected Age, ZIP Code, and Income as the Features that describe each public figure in the list, and collected data for 10,000 people (Samples). Since the data is in a matrix, it becomes a 2D tensor. The Shape of this 2D tensor is ** (Sample, Feature) = (10000,3) **.
3.2.Time Series Data(3D Tensor) Consider time series data of the stock price of a company for one year.
Consider the structure of this data. For stock prices, we collect data on 250 business days all year round. Stock prices are aggregated in minutes. The stock market collects 390 minutes of data. Select the current price, the Highest Price, and the Lowest Price as the feature amount of stock purchase.
Therefore, the Shape of this time series is ** (Sample, Timestep, Feature) = (250, 390, 3) **.
3.3. Images(4D Tensor)
Image data. First, suppose you have 128 image data. Next, let's say the resolution is 256X256 pixels. It is a color image and consists of three channels (R, G, B).
Therefore, the Shape of this image data is ** (Sample, height, width, channel) = (128, 256, 256, 3) **.
3.4. Video(5D Tensor) This is video data. For example, suppose you have four 60-second color video data with a resolution of 144X156. Assuming that the frame rate of this video is 4fps, it will consist of about 240 frames (240 frame = 60 sec * 4 frame / sec).
Therefore, the Shape of this video data is ** (Sample, Frames, Height, Width, Channel) = (4, 240, 144, 156, 3) **.
Data example | Details | Figure | Tensor | Shape |
---|---|---|---|---|
Vector Data* | Personal Data | 2DTensor | (sample,feature)=(10000,3) | |
Time Series Data | Annual Stock Data | 3DTensor | (sample,timestep,feature)=(250,260,3) | |
Images | Batch of Color Images | 4DTensor | (sample,height,width,channel)=(128,256,256,3) | |
Video | Batch of Video Frames | 5DTensor | (sample,frame,height,width,channel)=(4,240,144,156,3) |
Recommended Posts