This class implements a layer that trains fixed-length vector representations for the values of a discrete feature.
This layer can work only with one feature; when several values of the feature are passed, the sum of the corresponding vectors is returned.
// Size of the representation table
struct CLookupDimension {
int VectorCount; // the number of vectors
int VectorSize; // the vector length
};
void SetDimension( const CLookupDimension& newDimension );
Sets the size of the vector table.
CPtr<CDnnBlob> GetEmbeddings() const;
Gets the table with the trained vectors. The blob storing the table has the following dimensions:
BatchLength
is equal toGetDimension().VectorCount
;BatchWidth
is equal toGetDimension().VectorSize
.
The single input accepts a blob with int
data that contains the feature values, of the dimensions:
BatchLength * BatchWidth * ListSize
is the number of different values the feature can takeHeight * Width * Depth * Channels
is the number of values in the set
The single output contains a blob with the sum of vector representations of the given feature values. The blob dimensions are:
BatchLength
is equal to the inputBatchLength
BatchWidth
is equal to the inputBatchWidth
ListSize
is equal to the inputListSize
Height
is equal to1
Width
is equal to1
Depth
is equal to1
Channels
is equal toGetDimension().VectorSize
.