Feedforward
神经网络的数据表示–张量
张量的关键属性
Shape:
- a matrix has shape
(3, 5)
- a 3D tensor has shape
(3, 3, 5)
- a vector has a shape
(5, )
- a scalar has an empty shape
()
数据类型(在python库中叫做dtype):
- 一个张量的数据类型可以是
float32
,uint8
,float64
, ..- 在少数场合下, 可以看到
char
类型的张量- string类型的张量在Numpy中不存在(或其他大多数的库中)
现实世界中的数据张量
vector data – 2D tensors of shape (samples, features)
attribute information:
- gender
- length
- diameter
- height
- whole weight
- shucked weight
- viscera weight
- shell weight
- rings
timeseries data – 3D tensors of shape (samples, timesteps, features)
every minute, the current highest/lowest/average price of the stock
400 minutes in a trading day
250 samples (or 250 days)
a 3D tensor of shape (250, 400, 3)
image data
three dimensions: height, width, and color depth
a batch of 128 color images could be stored in a 4D tensor of shape (128, 256, 256, 3)
video data
a 4D tensor (frames, height, width, color_depth)
a batch of different videos can be stored in a 5D tensor of shape (samples, frames, height, width, color_depth)