The tensor
What is a tensor?
A tensor is one structure which is needed and used from many AI environments.
Basically the tensor is a kind of a 4 dimensional matrix, containing parameters for
dimensions and data itself. The 'data' has the information used from the environment,
this information may be color of a pixel, velocity of a motor, position of some object.
Generally it is one or more junks of bytes. The order of this data contained in the tensor
usually is a structure described through some matrices and vectors.
From the software point of view, I am using tensor in my AI developments as a class
described below
| n is the number of samples. This is the size of the vector containing the base data. For example, the base data is one picture, usually denoted by one array of 3, 4 pixel information (r, g, b, a). Sometimes named as ‘channels’. Form the software point of view defined as std::vector<Array of data..>
k is describing the number of the filters. Filters are quadratic groups of data within one array of data. For example one filter may be a quadratic small array of our pixels (3x3), (4x4), (30x30),(...)
nr is the number of rows contained in only one array of data, For examples 30 rows are there.
nc is the number of columns containing the data
size is the total size of the Tensor. It may be calculated as the following product: size = n x nr x nc For example n= 2, nr = 3, nc = 4 => size = 24 |
Kommentare
Kommentar veröffentlichen