CAccumulativeLookupLayer Class
June 14, 2020 ยท View on GitHub
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.
Settings
// 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.
Trainable parameters
The representation table
CPtr<CDnnBlob> GetEmbeddings() const;
Gets the table with the trained vectors. The blob storing the table has the following dimensions:
BatchLengthis equal toGetDimension().VectorCount;BatchWidthis equal toGetDimension().VectorSize.
Inputs
The single input accepts a blob with int data that contains the feature values, of the dimensions:
BatchLength * BatchWidth * ListSizeis the number of different values the feature can takeHeight * Width * Depth * Channelsis the number of values in the set
Outputs
The single output contains a blob with the sum of vector representations of the given feature values. The blob dimensions are:
BatchLengthis equal to the inputBatchLengthBatchWidthis equal to the inputBatchWidthListSizeis equal to the inputListSizeHeightis equal to1Widthis equal to1Depthis equal to1Channelsis equal toGetDimension().VectorSize.