CFullyConnectedLayer Class
June 14, 2020 ยท View on GitHub
This class implements a fully connected layer. The layer multiplies each of the input vectors by the weight matrix and adds the free term vector to the result.
Settings
Output vector length
void SetNumberOfElements(int newNumberOfElements);
Sets the length of each vector in the output.
Using the free terms
void SetZeroFreeTerm(bool isZeroFreeTerm);
Specifies if the free terms should be used. If you set this value to true, the free terms vector will be set to all zeros and won't be trained. By default, this value is set to false.
Trainable parameters
Weight matrix
CPtr<CDnnBlob> GetWeightsData() const;
The weight matrix is a blob of the dimensions:
BatchLength * BatchWidth * ListSizeis equal toGetNumberOfElements()Height,Width,Depth, andChannelsare equal to the same dimensions of the first input
Free terms
CPtr<CDnnBlob> GetFreeTermData() const;
The free terms are represented by a blob of the total size equal to GetNumberOfElements().
Inputs
Each input accepts a blob with a set of vectors, of the dimensions:
BatchLength * BatchWidth * ListSizeis the number of vectors in the set.Height * Width * Depth * Channelsis each vector length. It should be the same for all inputs.
Outputs
For each input, the corresponding output contains a blob with the result, of the dimensions:
BatchLengthis equal to the inputBatchLengthBatchWidthis equal to the inputBatchWidthListSizeis equal to the inputListSizeHeight,Width, andDepthare equal to1Channelsis equal toGetNumberOfElements()